Message ID | 20240607211358.4660-1-21cnbao@gmail.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <owner-linux-mm@kvack.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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66A13C27C55 for <linux-mm@archiver.kernel.org>; Fri, 7 Jun 2024 21:14:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E95106B00A3; Fri, 7 Jun 2024 17:14:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E450C6B00A4; Fri, 7 Jun 2024 17:14:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE7576B00A5; Fri, 7 Jun 2024 17:14:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id ACC406B00A3 for <linux-mm@kvack.org>; Fri, 7 Jun 2024 17:14:22 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5271C40477 for <linux-mm@kvack.org>; Fri, 7 Jun 2024 21:14:22 +0000 (UTC) X-FDA: 82205345964.29.98164B8 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf25.hostedemail.com (Postfix) with ESMTP id 7D65AA0008 for <linux-mm@kvack.org>; Fri, 7 Jun 2024 21:14:20 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fulmUMdj; spf=pass (imf25.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=21cnbao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717794860; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=SgcxjirVqsAvgUPWOPPhW9cui9hZtZdtPFLjs4Py2VQ=; b=d91+Ox5ybx+HQxWfvwBkph2UBKpiMfZj3j//9AzAunQEn9Zy+4awbTCd0UrFEp4MG334Vt 3pH81LzQOtrFHBYP4JzreLnt/aAoMQ4ws5knYsmFjE/TA/bmUOTgUbmHKy0vDgfPL1zkDX 8Wc+70ZR5wvhlr67vUP9Bp/pS3IYUUA= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fulmUMdj; spf=pass (imf25.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=21cnbao@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717794860; a=rsa-sha256; cv=none; b=3iqlwOkZ+e4ikIXgwZS4x8+uURwqfhdoZ8/nk43JoZwOxv2aao4Lr+EsZirPrwVnDhMziR Kj7hi9cGJ+KDwsW3Tq9xRMKxPIIeEZHHeTNQTdwdVwe9uZaRK1ByUmHqOSqgjDa9pTRr9W keUy1Bh89ii0EaXmRwoagRu0iXs12hw= Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1f6c7cded01so14781585ad.0 for <linux-mm@kvack.org>; Fri, 07 Jun 2024 14:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717794859; x=1718399659; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=SgcxjirVqsAvgUPWOPPhW9cui9hZtZdtPFLjs4Py2VQ=; b=fulmUMdj8cOybSMJMTBWFyNCWKIMcIJwwKtYPK3f4v028kLKE0t6kXy/R9fJ1uWJYl 4rTJRzYgweEklWtLlspIQMNwaUp2RJqoZuz8Exh6a7SFMsBQlSCSqz50WLNg9QXSNBYQ vwjDNZIN8rU3HCBaQpAawU0sT+KHOomZqIkrEdIdwLOM5Z8685RGvV5w/fglXxKUTQLi f2ag3NaNvCQPaEg1EduGwL7JznRja7vOwkakgSSpTF9oBRqVuUWTueWGAEzy7wQiXmz2 8j3kgQro9V5dKylj4HyjGidBk4u8XTAw158r7zQ9rldGvFJoDUCZGSVZXGQGbBAgidyv wFwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717794859; x=1718399659; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SgcxjirVqsAvgUPWOPPhW9cui9hZtZdtPFLjs4Py2VQ=; b=AOBbB2FgePjxKN8pZS7xX2Y7pw3twKTkANypN5WAsnbxb/ryusg5U/PGzD3w8ORCc5 cfQztjROe0LZB7hedzNsWVwPnTe/InUvIfw30HHPB085BSlMaJOYexbuQRZHPF/Yr6c/ tFNYTl6LdbU1sYrL+KqkdxDqmZGylkbGqDScetNJIXfYsLbdCgSF/MFvynAiKo4lnwU8 riBaGNzvp4/ItpX/bg+o0uCMpy4y/kc5w22Uf5iFPoSnH2Qen2g2bHfpWI6FfnwcSKhU 5kdcDcd3F8DytXWjgZ/6wNlaf9o367xMSRtPKRcKmkbh1RPu7UyiY7Uwmuxby9ylBTv/ 4EPw== X-Forwarded-Encrypted: i=1; AJvYcCUFdZbzn/5euJdsVJy7MhmegSTLJQ9rGXkSeupVbiA8FRj9qZoUGyU7YyTN3XWG33ege0fsWAJhfV+RkPoEw2OaZ9s= X-Gm-Message-State: AOJu0YzeQKnF3j/AjxUwnp0WXBCaO8MLwcoH1mh4Knoat9r8e9i6YeSy tzk1jDA5eRUVg3LpCFxFSF2xYRB1CcSG9cdsSife0w2uG2oS6YUr X-Google-Smtp-Source: AGHT+IHTd8X/qWpPzrmVP3cjEjhpM6LTclHmUzVMfHbR6wSNSFbYa4J+jFqkRsLLUl8yINr0c7mPyQ== X-Received: by 2002:a17:903:1c7:b0:1f4:8faa:cd68 with SMTP id d9443c01a7336-1f6d02f1b75mr38515985ad.29.1717794859212; Fri, 07 Jun 2024 14:14:19 -0700 (PDT) Received: from barry-desktop.hub ([2407:7000:8942:5500:aaa1:59ff:fe57:eb97]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6d859ea3csm17912255ad.178.2024.06.07.14.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 14:14:18 -0700 (PDT) From: Barry Song <21cnbao@gmail.com> To: akpm@linux-foundation.org, david@redhat.com, linux-mm@kvack.org Cc: chrisl@kernel.org, kasong@tencent.com, linux-kernel@vger.kernel.org, minchan@kernel.org, ryan.roberts@arm.com, surenb@google.com, v-songbaohua@oppo.com, willy@infradead.org Subject: [PATCH v2 0/2] mm: introduce pmd|pte_needs_soft_dirty_wp helpers and utilize them Date: Sat, 8 Jun 2024 09:13:56 +1200 Message-Id: <20240607211358.4660-1-21cnbao@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: emt9b5918gub6znxb9r1kr7zbbunapna X-Rspamd-Queue-Id: 7D65AA0008 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1717794860-623795 X-HE-Meta: U2FsdGVkX19vycMoCPzbkYhhRsE/z4n068ILSichCh20iu64GsVJmo4Q5ZbuwS/gpI7XUPWulJA2V9N+ebwdD+VKFiKJxOgzrKBvFuA+6eMsKlGWlrCbYvEwWtI5mQpPKYD4WR0fFWfYHAhiczX3ZhuCasm0NnXbUkmHWTAhyD1fGUCqRVBXpHqsB6Jy6mDvLDhspdpOrEPX/UKDKOnK3eMRVOADPJ9kvcyuxk+s4k5XRze5vr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attZDb9xvPjwrGlmwgAhIDEnnmh48ECVe6uLBhPC6/PuUzrmtbhHaTCDFAAH4UVeJoIVM3uK6AbjkOMioUhKQ+Q+3bs3OxCQmxz6FuBzHSHdoRUFTK4bEBQqUUtNdYsRVEYaSx+V8RK1EOg9Dra6sawsDipvgyLAc1dABxJNeWxKCdV7zw+tzBrAX0ki13X3/JSgbFX0GyirSVxdfzQB4TRVp2Xm0Wb6Bi05u7WrT+PrWN33qLOuVBge7/t0VHHJxtWQkiHkObqNCyknT2S6UmNkkEe197Y4bajPv1w2lUME7VARWxLup8WCRAA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm: introduce pmd|pte_needs_soft_dirty_wp helpers and utilize them
|
expand
|
From: Barry Song <v-songbaohua@oppo.com> This patchset introduces the pte_need_soft_dirty_wp and pmd_need_soft_dirty_wp helpers to determine if write protection is required for softdirty tracking. These helpers enhance code readability and improve the overall appearance. They are then utilized in gup, mprotect, swap, and other related functions. -v2: * rename "need" to "needs" per David; * separate the change of do_swap_page() per david; Thanks to David for his original suggestions on this[1]. [1] https://lore.kernel.org/linux-mm/baf84b51-7e8a-4da8-9662-3f5cf14ad6f6@redhat.com/ Barry Song (2): mm: introduce pmd|pte_needs_soft_dirty_wp helpers for softdirty write-protect mm: set pte writable while pmd_soft_dirty() is true in do_swap_page() mm/gup.c | 4 ++-- mm/huge_memory.c | 2 +- mm/internal.h | 10 ++++++++++ mm/memory.c | 2 +- mm/mprotect.c | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-)