From patchwork Mon Oct 21 16:02:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Houghton X-Patchwork-Id: 13844374 Return-Path: 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 63EDFD15DB6 for ; Mon, 21 Oct 2024 16:02:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E29046B0085; Mon, 21 Oct 2024 12:02:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DD9386B0088; Mon, 21 Oct 2024 12:02:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC8566B0089; Mon, 21 Oct 2024 12:02:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id AD4896B0085 for ; Mon, 21 Oct 2024 12:02:37 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 45F2AA1A88 for ; Mon, 21 Oct 2024 16:02:09 +0000 (UTC) X-FDA: 82698076944.02.2B84C59 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) by imf11.hostedemail.com (Postfix) with ESMTP id 8D55F4002E for ; Mon, 21 Oct 2024 16:02:17 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=LbeSK5rT; spf=pass (imf11.hostedemail.com: domain of 3GnsWZwoKCKkScQXdPQcXWPXXPUN.LXVURWdg-VVTeJLT.XaP@flex--jthoughton.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3GnsWZwoKCKkScQXdPQcXWPXXPUN.LXVURWdg-VVTeJLT.XaP@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729526406; 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-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=xS8RR8lB059oPyR5mt7J0tawOIdChogU8TDyO7jPWP4=; b=3FnU5aOjgEBIhIkqH1mFhHacDgYt6X/sKPh5fkbQRvgXwKSW2LA52+67KXysjBx1+Lbsm7 d9CR4qPyV2HnfnO4EE2GTBT58L7hLGrc4lEsqYjRlZ8luxbpPzu+39dkSKnwyC71uQ2wWA py6QiGB+K7MUJJsmRL1cZyMcSgXAbi8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729526406; a=rsa-sha256; cv=none; b=fhg2Ya3SNTH+5lgzmIXq4irIcBYj4xfOZ5Q5bghcmeb8J6jdleNCeED4KF5mKJHP/u42uI N9GBqsUXeYR8KTl8JZ2UcbKePy5ds4n3Qpt8m5UY/UMgodfvEBV++0Y2t+Mkn8BwLs3TVQ Coj1fkyD7CLwwe2gZJGOiKnHUFj8MhM= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=LbeSK5rT; spf=pass (imf11.hostedemail.com: domain of 3GnsWZwoKCKkScQXdPQcXWPXXPUN.LXVURWdg-VVTeJLT.XaP@flex--jthoughton.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3GnsWZwoKCKkScQXdPQcXWPXXPUN.LXVURWdg-VVTeJLT.XaP@flex--jthoughton.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e2b9f71917bso4578644276.0 for ; Mon, 21 Oct 2024 09:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729526554; x=1730131354; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=xS8RR8lB059oPyR5mt7J0tawOIdChogU8TDyO7jPWP4=; b=LbeSK5rTrZnE37yNI2jHSETXSZNb8ouWOzyK9ZuKOV5mf6+xArBcEOErkRnnRvbX88 C80XmcchQLPKqMzfz73ma2j5svnAj7wmEldrxjemu0IBlQFjM7Es1BmWFncmlKYPssU5 6vwfZ7V+srjRSnbIcnezY57MfNXXv2hRpr47J5kmyYIHmcWv2eMWW+hk5OZCv/agykh1 VlszaAAIkQU7VKL+g6dHiy3IXNmOzk1jUv+XUybT4izKqF6qh930m6IrK5BEWMErmAcz Zs5LiTjNoOk3IohPP0yu9Er1H3d1HqgstqBcVrFJR1rg0JTVca+e/EeG6p8ewAEhK1Zx FL8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729526554; x=1730131354; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xS8RR8lB059oPyR5mt7J0tawOIdChogU8TDyO7jPWP4=; b=WsKpqaHnOPKqrZ//5mMRlXsLFtss7zOK1W2YtUT396d/uwCeJ0Gbf+Xda+b2fPRoQb JicGvNNSM9yTcOwmv2P6QRRvI8uAEmPLhT74xV5qo/fpL16M/H1f+tRpCmN8nzBEnWf1 zfXEiKtCJyzKuN8CLBwWbX+YK0un096Z1HZaG+Z33RYcuE87Am1ab5hI/jFAtnHWiSPL 3OXqMU3jfI05yZOD4B2wUmJas8HCKY24mu3y4AhuaqqxUraWbW5JTIwTEVPHVr5dbcav I4VQzOC04qfk1So1HsiaxPivydVjnbIaTgcA83ltLywiDiTT9p5tB9PYBdF/UDRSYJZB 8GHw== X-Forwarded-Encrypted: i=1; AJvYcCVAWF7p1Hrxmk3W5ndOV7eATcEhEQMZiCUVR39OmBtLuDV3zeabyzA29zbogHsAkoC838rI0Mhhpg==@kvack.org X-Gm-Message-State: AOJu0YxB8bOk4ozrO2aPtp+BhQ0Nl222Cw8f+ROE/RJEC6aJ3P7NYbv1 WshgmzORyfeHD0h8VHmSH3wdtk6r1pEKS7v+0p8CMkDQ7c5Lj0U/7QWsQfM3UJm8qJ1HPGaLrmh v8Eazm42Ku+Eem3Ciyw== X-Google-Smtp-Source: AGHT+IGDNzg+raVpdy9asgo0adGMV8bfu1r5gOhX68FDbWgpgo+ybonbytlhVGcQ6fwb8NaxBtgJYObRec+ukV0u X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:13d:fb22:ac12:a84b]) (user=jthoughton job=sendgmr) by 2002:a5b:503:0:b0:e29:7587:66d6 with SMTP id 3f1490d57ef6-e2e245964c8mr62276.4.1729526554296; Mon, 21 Oct 2024 09:02:34 -0700 (PDT) Date: Mon, 21 Oct 2024 16:02:12 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.47.0.105.g07ac214952-goog Message-ID: <20241021160212.9935-1-jthoughton@google.com> Subject: [PATCH] mm: Add missing mmu_notifier_clear_young for !MMU_NOTIFIER From: James Houghton To: Andrew Morton Cc: James Houghton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Jason Gunthorpe , David Hildenbrand X-Rspamd-Queue-Id: 8D55F4002E X-Stat-Signature: i5h1fg7ijxky7acusgozwr6ekzrqy8mt X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1729526537-988396 X-HE-Meta: U2FsdGVkX1+B9kX1z5F8XcfKX9NUnVdPvKYgY8Dx0AURt+8asl3ZFGTHg8zumqWRhkDudhPjr5TPEXrQcnKXKkOs/UdDnnS6Kr68kDFvUGirTCa2/+4RLGuOBUSXiBmhig6vMv08C/wjFPAhhTW8tu0AtJQAIL669NsZ5ZTtPXpW5AezniEeovZUIwDQA95ayJyVNMcQlchO2tloc06DZi9H4SlH+hvCNulCX2oqAAvfOFEKmax+1nwuIaO0ZWTlA50KFsN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vLQhsZsVchsP4h/zxX44A7U4wvt7eZavtd9Ex4aNZZn/Y4zir17NlU5+YH+j19sLnaw3cEC2IcTJL8+SMKp2ArzrA4WmvqZiRGWnMdhfmpHO3UVxrgMcHW7IOP1oQiWBWLG5Bp8RLuQRVBHiDDZsiiGFCzIdAL4kg25LlMtt5mIlZMviDue0SPm9nXHGRYMxdfHPm/x9a13fgKCLxQggQv+pfJtj4+1KFHiotHgE7ycKXQdMIE0Eg9/EFZWwA/HW1Qvi9tlfSSf4GyRX0eAPpSmZWyUj+uHqROPIYAUAAdnPtoSyHg+x8Ais3jRoMui0G8ja9WpNk8W2WQ8Ltie7HKJaNm42yiL9Jliy52051tWzf+9ZGpOHOZzyWWfVYqTNu3bdyyO0WNZX57bdwbQ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000008, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Remove the now unnecessary ifdef in mm/damon/vaddr.c as well. Signed-off-by: James Houghton Reviewed-by: Jason Gunthorpe Acked-by: David Hildenbrand Reviewed-by: SeongJae Park Reviewed-by: Oscar Salvador --- Notes: This patch is originally from this series[1]. I've split up the MM and KVM bits of the series, and I have already sent the MGLRU changes here[2]. That leaves this small cleanup for DAMON. [1]: https://lore.kernel.org/kvm/20240926013506.860253-1-jthoughton@google.com/ [2]: https://lore.kernel.org/kvm/20241019012940.3656292-1-jthoughton@google.com/ include/linux/mmu_notifier.h | 7 +++++++ mm/damon/vaddr.c | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) base-commit: b5d43fad926a3f542cd06f3c9d286f6f489f7129 diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index d39ebb10caeb..e2dd57ca368b 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h @@ -606,6 +606,13 @@ static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm, return 0; } +static inline int mmu_notifier_clear_young(struct mm_struct *mm, + unsigned long start, + unsigned long end) +{ + return 0; +} + static inline int mmu_notifier_test_young(struct mm_struct *mm, unsigned long address) { diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c index 08cfd22b5249..821990d0141a 100644 --- a/mm/damon/vaddr.c +++ b/mm/damon/vaddr.c @@ -353,11 +353,9 @@ static void damon_hugetlb_mkold(pte_t *pte, struct mm_struct *mm, set_huge_pte_at(mm, addr, pte, entry, psize); } -#ifdef CONFIG_MMU_NOTIFIER if (mmu_notifier_clear_young(mm, addr, addr + huge_page_size(hstate_vma(vma)))) referenced = true; -#endif /* CONFIG_MMU_NOTIFIER */ if (referenced) folio_set_young(folio);