From nobody Fri Dec 19 17:01:50 2025 Received: from out0-206.mail.aliyun.com (out0-206.mail.aliyun.com [140.205.0.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 642FD804 for ; Mon, 26 Aug 2024 10:13:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.205.0.206 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724667230; cv=none; b=c+6HV8PClKu3TVP/QtqBOcCfSLBdYn0CyfryAi47vtsPQzeC4h1FED4/2EBpdnlEoZwUP4zTYxtbbLJDtRAHyqX80ZbSbLxIwNXCGLPpIISCSB7EvarFH6Kd0ULdKP4MgXyQFWfoX3W9Emkhi4LKinwLbfkdMfwjWJQuP0YAA/4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724667230; c=relaxed/simple; bh=vrr0pFgKlFH8zr7+GGp+kmqkEdG880bRycdUnGqf6EE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ONxlI3/5y7M3DbQhG4aPVom56IDWrOflF3+/tesbE34MgCv+8oa+wPe6y+zsiY00f/Wv11IZ3Vr13Co46FFRX6D7mJlLEA4jK4YWcCyoJcxqYJ+ds4PrL57A+VohSsTBe7SvaDY99ZdHXmcdIAORKBFZEjpzcCFkCtaVCamtJ9Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com; spf=pass smtp.mailfrom=antgroup.com; dkim=pass (1024-bit key) header.d=antgroup.com header.i=@antgroup.com header.b=H2ONJIz5; arc=none smtp.client-ip=140.205.0.206 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=antgroup.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antgroup.com header.i=@antgroup.com header.b="H2ONJIz5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1724667224; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=jo0r7PE2P21mYE53WxHNzNjxHnLxdNhP0Cu28IOO4aU=; b=H2ONJIz5NzrJTsdUXyoQzylVOFLlDxlzS6jqCMLnlORifzSRyr4v24mqUfSQ+wpedgp3AUQQ3GnxS6Jk/WV4ApRRQptSZ8gYx3tM5TMte1DMgCH8MVWDySSOASwFcF2cSujpc+7nZGvMcfVcOCCIWLd5bf2eVN3B7n/G1Bj+W0k= Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.Z2YRscp_1724666906) by smtp.aliyun-inc.com; Mon, 26 Aug 2024 18:08:27 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , "Tiwei Bie" Subject: [PATCH v3 2/7] um: Remove the redundant newpage check in update_pte_range Date: Mon, 26 Aug 2024 18:08:10 +0800 Message-Id: <20240826100815.904430-3-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240826100815.904430-1-tiwei.btw@antgroup.com> References: <20240826100815.904430-1-tiwei.btw@antgroup.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The two checks have been identical since commit ef714f15027c ("um: remove force_flush_all from fork_handler"). And the inner one isn't necessary anymore. Signed-off-by: Tiwei Bie --- arch/um/kernel/tlb.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c index 44c6fc697f3a..548af31d4111 100644 --- a/arch/um/kernel/tlb.c +++ b/arch/um/kernel/tlb.c @@ -82,16 +82,12 @@ static inline int update_pte_range(pmd_t *pmd, unsigned= long addr, (x ? UM_PROT_EXEC : 0)); if (pte_newpage(*pte)) { if (pte_present(*pte)) { - if (pte_newpage(*pte)) { - __u64 offset; - unsigned long phys =3D - pte_val(*pte) & PAGE_MASK; - int fd =3D phys_mapping(phys, &offset); - - ret =3D ops->mmap(ops->mm_idp, addr, - PAGE_SIZE, prot, fd, - offset); - } + __u64 offset; + unsigned long phys =3D pte_val(*pte) & PAGE_MASK; + int fd =3D phys_mapping(phys, &offset); + + ret =3D ops->mmap(ops->mm_idp, addr, PAGE_SIZE, + prot, fd, offset); } else ret =3D ops->unmap(ops->mm_idp, addr, PAGE_SIZE); } else if (pte_newprot(*pte)) --=20 2.34.1