Message ID | 69e1c4483c2d679d3e2c8446264e5878e5b52a97.1727148662.git.zhengqi.arch@bytedance.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AE66FCF9C6B for <linux-arm-kernel@archiver.kernel.org>; Tue, 24 Sep 2024 06:16:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=C6e2rRMn75kFV6Fv258+yl1EB6KpOV48BOzHpMuHQ/Y=; b=vxXPi8cziOGZy3e6m0Pf+T/E8m WqwpxTPJr1zZPTvNnu201gl1Y+v3e98RDTKLtQZX3udClEOCUcOyKT9EpQSgSXQmflK2tt4pulA5r p4C3nl6PFHdZamwpCAPVv8Eu1v9KGn+gIIaEaNhBWMzY+RPzgOyp/y+PZbaTHYSvmp84pU9irpMV8 Is9ipr9GYodNrWPJf8pjxo7dHSoWuD37wRAmBbYANvhAZCTUnNphrFwjokzs84pJYh7AJYrATL8SZ +z6+19hogzLcxGN4QgqbUj9ycZaSIGkqiOfPxxUMgZALhzr79YYbwlMz5fa2apd4LeYgUyb4EfnfL dI4jlRCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1ssyqb-00000001DXO-2y4m; Tue, 24 Sep 2024 06:16:29 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1ssylC-00000001BoM-2kyh for linux-arm-kernel@lists.infradead.org; Tue, 24 Sep 2024 06:10:56 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2068acc8a4fso47161285ad.1 for <linux-arm-kernel@lists.infradead.org>; Mon, 23 Sep 2024 23:10:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1727158253; x=1727763053; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C6e2rRMn75kFV6Fv258+yl1EB6KpOV48BOzHpMuHQ/Y=; b=TeNaieQtHUQBOF0qFk0bvfgu/Zv1lHP2hmhoLDfH4FKlay8Du5T/s947bC/LIeJTnZ 4lqmWalV+cxt3+0BhfoR+/tuxR9wRze8zV5v/VYD76j7sMKJ1rN8di71sTghw/tkTwNZ Ym2M70jo3F8ruv81tKMIydt9ojNPf/34z6oB4yw7PAPnFrsS+ZtBV7W78b0qhM8uvdbp +zCeSDbPaEzfqWDX44nxLr6PP6Cce/l2HEHOHQGa60Ey9bdRynoYRD1VEpZ09/zPko7A kFvwCIp1tOUdQgSjck6bdlPUx2CKhhcF+Omu04BP3ljfbnGW64g/fgdh1zxcX64QsH0S +yuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727158253; x=1727763053; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C6e2rRMn75kFV6Fv258+yl1EB6KpOV48BOzHpMuHQ/Y=; b=OH0NGj1HJ4+/p8dYpovZnAzwxiXVKwYxBoPJHrpO17GFiSOe2vUFZCoB2IdK0SrIIe me5G/Vd8NlbEpjoJGn42HUFFpCv8/NXm5mAwmBToa4xjK+rhz9jzJl6sw76oTYfm4w4U E8a/vslimLkGwqBz6+/kQsC1ykDIHeUBmeAb2IlktH9DWvHMuPpZKeLS/UwLMkmUxtxX F0mf6lft1O1TQgbdo6EhE1ukzuwmk8jHHDsKplHdt/jIBcmkL7jc75oHACrLn8XpaVAJ +cD+gejjrqpKC+T5+7ku7Fc7NfAVRUTmjmWSOa9G9db3VmBEdgjIInMADrCv8tyTaLpD 1zKw== X-Forwarded-Encrypted: i=1; AJvYcCWUGN4vvU9dorO/6+Ad6MSero/4k3X2yU/noVNmrravTiMn0K7XhNPj0ox88o4rd33KRD71vnJdHe5f1zxh9wdZ@lists.infradead.org X-Gm-Message-State: AOJu0YxqpyTNrNQ7WbUc2bk7G9f5Er07ydU824wDHmdwnSpdgNaTrC+H UOLJy1dxArlX8xnQQNbPL5Ct+4GVtlkK+mptEWfLrkVcRHM9mD33q8pXesv7I34= X-Google-Smtp-Source: AGHT+IEXIad82sT4qTFz/mgMdJh1108B7x8i2K/1dZJvW9IHButimBDIW5JZoOsyX1eaQQUsC7JSYg== X-Received: by 2002:a17:902:c94c:b0:205:4a37:b2ac with SMTP id d9443c01a7336-208d83c8698mr211905735ad.34.1727158253643; Mon, 23 Sep 2024 23:10:53 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([63.216.146.178]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af17229c9sm4344885ad.85.2024.09.23.23.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 23:10:53 -0700 (PDT) From: Qi Zheng <zhengqi.arch@bytedance.com> To: david@redhat.com, hughd@google.com, willy@infradead.org, muchun.song@linux.dev, vbabka@kernel.org, akpm@linux-foundation.org, rppt@kernel.org, vishal.moola@gmail.com, peterx@redhat.com, ryan.roberts@arm.com, christophe.leroy2@cs-soprasteria.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Qi Zheng <zhengqi.arch@bytedance.com> Subject: [PATCH v4 04/13] mm: khugepaged: __collapse_huge_page_swapin() use pte_offset_map_ro_nolock() Date: Tue, 24 Sep 2024 14:09:56 +0800 Message-Id: <69e1c4483c2d679d3e2c8446264e5878e5b52a97.1727148662.git.zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <cover.1727148662.git.zhengqi.arch@bytedance.com> References: <cover.1727148662.git.zhengqi.arch@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_231054_751191_9EDBC79E X-CRM114-Status: GOOD ( 12.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
introduce pte_offset_map_{ro|rw}_nolock()
|
expand
|
diff --git a/mm/khugepaged.c b/mm/khugepaged.c index f9c39898eaff6..6498721d4783a 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1011,7 +1011,11 @@ static int __collapse_huge_page_swapin(struct mm_struct *mm, }; if (!pte++) { - pte = pte_offset_map_nolock(mm, pmd, address, &ptl); + /* + * Here the ptl is only used to check pte_same() in + * do_swap_page(), so readonly version is enough. + */ + pte = pte_offset_map_ro_nolock(mm, pmd, address, &ptl); if (!pte) { mmap_read_unlock(mm); result = SCAN_PMD_NULL;