From patchwork Wed Jul 24 01:10:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Houghton X-Patchwork-Id: 13740529 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 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 4E995C3DA63 for ; Wed, 24 Jul 2024 01:13:24 +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-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yD4XBA3wulmfL9cZplrhNjvZpnpcy308OK8qykR4vJ4=; b=gBSJBM3J42r99+uguqZ/vuvKMq ZTi0JQwgT7t/3CmCpnIDog3Cl+3ZJ9u7Di4RIsD2tSNZnNJ3C5ZDqAbv2jgPMlkcBs2K1h8GtgkTJ iDHfC8I9sonmBuUMhJj2MCmqb+G0fV/xC2yaqqVwxJHndp/QKwuiNuo0LNog6QA8kUQWlc8r7aJ9Q t3nKNPA+cu+e/KtTR+Appoc5RkJkcwubaj3Ce0V/DIsChA3MO5oMqDUyfs8BDvLCXmh0+2rocmdoL VqE53WpgGAW1pFwzHfrHI0KJ+fwDg8GrXMBenRRRefzx0eWFaIIinf23MLdFzVHc+GdqNGymgnfK6 UcZgvGUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sWQZ7-0000000Dy3Y-1XoK; Wed, 24 Jul 2024 01:13:13 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sWQXG-0000000Dx9E-3gJ0 for linux-arm-kernel@lists.infradead.org; Wed, 24 Jul 2024 01:11:20 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-e0875f9f7ceso801586276.1 for ; Tue, 23 Jul 2024 18:11:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1721783477; x=1722388277; darn=lists.infradead.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=yD4XBA3wulmfL9cZplrhNjvZpnpcy308OK8qykR4vJ4=; b=iHu0HHy1qmgbZtoqAmyrXTO10/O4mVS/+KR0sQWgsRWEzkBSHbEcxq6CN1zVAK/DEp GtxaHo5GY8GdeuGyCjt25C2c5K7usUyg02c6/pWX7LqHydfnIope/wZ93kc2tZBLMbJp y8Cl5oKT8/R1XfX6ARNgSuh0xaQdIyBOssdfvAGDgU+qEfm7jL1y++n6rZ2ulb/yiRI9 Wv7gM5TdS6UeUo9Dw+WWPg1NE3s0kKThZCJXI+/78NporufUSvhRncQXpyoiNBOP7Cg8 cz5IQsZ4wqYrwCSiSqqLgSFp/P8IFrxch/gAcKW5u4uovE6sE5xVkJC4n8nfAAoaOnFO wmvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721783477; x=1722388277; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yD4XBA3wulmfL9cZplrhNjvZpnpcy308OK8qykR4vJ4=; b=MuoI3KzwJXI2hmMdr70uwnup9DESudf0xer1HseXYW+BhrrYUZkTYUqn7qJI7iQEQm P4H/V47kgBqL8nb55Gr7txm9or+WGTDx3prRWRLO7kk0R/gLEzfqTEZ60JrNvGFFTUUk Ymlk1zdvI17ZkRM9ffS/D81ZkH1scc44zFcweupbtjzj9S9X+OYEgQTWxXnkDrS9aPoy 3Olvo1l051ScYvq6cd+VR3FQgv/X/+ADklYiYWuGziTp7M6Y48F38Iryay3Mz9ATfdBf Ozzf67Ne5h4aopMi1l27NkO7eZQNNgv9ZY76DOf/4qvAhwhZBXHfU1PKlmCRmIV5kOBZ dzRg== X-Forwarded-Encrypted: i=1; AJvYcCWjqrP/LL5ErqfSc5lFf99NDasdGIGgOjb01aDlJabGfGz541tHFxyX2OVP83KG0k6XW4iC5BR/coJC1wiY7cEL0gu6igiWEZdrW/AnQqmeryKV+4o= X-Gm-Message-State: AOJu0YygtKkJ4NmCaqSnhLZT2gaW3tURLEFx/z4AGDNV9OKcsBmEuOVS c2jdmySPYuBjqyFXADUvf+eYDijenjgm2ToTRGA8JX9FJ3Od3zzpcIzchiKTuhsFoTsXIx+/ueh X+31cmtcDvh+OYoss+A== X-Google-Smtp-Source: AGHT+IGa8qCTH1LNH/hmEAmVML0lM3qLC3vgS4lo0iysyChD5iecelBKp5Dde0rCv2FIne41yj4Q4w4VDl3wLvaY X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:14:4d90:c0a8:2a4f]) (user=jthoughton job=sendgmr) by 2002:a05:6902:72b:b0:e05:a1df:5644 with SMTP id 3f1490d57ef6-e0b115446e0mr18142276.2.1721783476871; Tue, 23 Jul 2024 18:11:16 -0700 (PDT) Date: Wed, 24 Jul 2024 01:10:29 +0000 In-Reply-To: <20240724011037.3671523-1-jthoughton@google.com> Mime-Version: 1.0 References: <20240724011037.3671523-1-jthoughton@google.com> X-Mailer: git-send-email 2.46.0.rc1.232.g9752f9e123-goog Message-ID: <20240724011037.3671523-5-jthoughton@google.com> Subject: [PATCH v6 04/11] mm: Add missing mmu_notifier_clear_young for !MMU_NOTIFIER From: James Houghton To: Andrew Morton , Paolo Bonzini Cc: Ankit Agrawal , Axel Rasmussen , Catalin Marinas , David Matlack , David Rientjes , James Houghton , James Morse , Jason Gunthorpe , Jonathan Corbet , Marc Zyngier , Oliver Upton , Raghavendra Rao Ananta , Ryan Roberts , Sean Christopherson , Shaoqin Huang , Suzuki K Poulose , Wei Xu , Will Deacon , Yu Zhao , Zenghui Yu , kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240723_181118_967641_1DC5A016 X-CRM114-Status: GOOD ( 11.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove the now unnecessary ifdef in mm/damon/vaddr.c as well. Signed-off-by: James Houghton Acked-by: David Hildenbrand Reviewed-by: Jason Gunthorpe --- include/linux/mmu_notifier.h | 7 +++++++ mm/damon/vaddr.c | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) 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 381559e4a1fa..a453d77565e6 100644 --- a/mm/damon/vaddr.c +++ b/mm/damon/vaddr.c @@ -351,11 +351,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);