Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2249468rbb; Tue, 27 Feb 2024 16:16:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUO9totYHLz/3hDATg1rB0B+Fbj4AMXD+F8YkfH6SQaLaCxVgFGDvu+mi77FJqJmHBEUTNAqk0B5ZO7D+UYV9uYRG3SIx/HGaGYtJrLwQ== X-Google-Smtp-Source: AGHT+IGHnRdeD/z/JxHX/MVHyX3hPokDbLisoBOlcAq5NHfbbSEp+YwHlUQTMX5ULro9oDKNyW96 X-Received: by 2002:a05:6830:13cc:b0:6e4:31fd:bfb with SMTP id e12-20020a05683013cc00b006e431fd0bfbmr13247629otq.27.1709079367932; Tue, 27 Feb 2024 16:16:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709079367; cv=pass; d=google.com; s=arc-20160816; b=KBBzovH/WSiHIItpfSjqaOmp48thz6dWBigte3XkrYgiR1P+AGcdWADIkWpenA/Jkt EhA05pBdGnJa2In4b0C8f8ADY9BfEK2tKUhyoR/ub8WU1Uq4A5+fuy8geovAGxUnZB29 /Clm586HMj+KnJUVrY5ZNktxGCStBfYCVrAGP9YetaIo+ZVwvotkyQH6V2PH/yzhb+i7 7McYJpTRyalQCs+lh1TRpk6H6A9H15Y4i45sFnAXrv+h370yVFysOpzePOPtTTV2GHmI Cq8GahBqzExiQBDK60Gsx+CBSy0gAgn53hOJiPnnj6kYfNvekvNpHnYZjIJXm6HKj/Fe TRMw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XpKu5xNPqsnNWvTrFIU9il7S4RM7zjHulsB8it+XFF8=; fh=I5r8VXEzTIObpPmlvUxZLl9cXucZOOaiOt1HRjC3qWU=; b=wREklQAtQjvoFApYhDgntXrzJheREVuytDxFAAvPNkPNehtJ3nDvosaUHTgpbV9keI SLaSgLOm/Grk5sMnYkXH3XUEY3vTt8vmFnnUVg/y83Uzf4YDLQjL8BXrnypSwjkB85qF 322p0JifUmgZazjZlfa/cTVSwP0rEgax/LPYbwSCYw5FOjYGoGqQwD35urAnTnBRWnvt BJnb4ggVn/GwxVlD0jydO/FS3nRsbpml0oUdtkyTD+WttTF36vkX8X1Tv61F5YrDX2TW dIywSL2dG7hAug3Rvhurk9nhkxguiCSQZfaW0DjxRpQelU3qOvcLN3i6xypxo3HTqpip 1Ouw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NuEpe6D9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-84265-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84265-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b7-20020a63e707000000b005dbd83521fasi6265025pgi.883.2024.02.27.16.16.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 16:16:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84265-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NuEpe6D9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-84265-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84265-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 05ECA2866A4 for ; Wed, 28 Feb 2024 00:15:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FCB34A23; Wed, 28 Feb 2024 00:15:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NuEpe6D9" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 399943FE1 for ; Wed, 28 Feb 2024 00:15:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709079306; cv=none; b=Ey0sVe198+c+JpQkKdGckY2rvjOKeUreL9VCwBQqyD7A5AQ3sm1qyyoo+k24MmLsNu2wWB/CNTLGHGJxn9udFdw9QHbxuWEvyve4nsMigyjcEYXF7dCLil7bdndUAFastp+h+5eSX9njKaPhe7MgROwTFcLwdBOkCjC8FjYsyAA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709079306; c=relaxed/simple; bh=OdKHnKl7doxKIzicvERJ1M7c5v4jJA6BjcEqfg89J+w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=g0BZcyRWvzedknmv8L62nG+V/LJHPI0R5g7ZDlH3H4CimX+wzcThhf1xErcJPKO7sBMcuMCz375UOOEWKy88QilXAV8OmwjJD5OCl6ruJl3241F+hBSYRfB+wR6Vg60szGdPDTxGHmlg5FiEhzHgSOT3+uzY2vcedASc1yKOBXQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NuEpe6D9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9120C433F1; Wed, 28 Feb 2024 00:15:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709079305; bh=OdKHnKl7doxKIzicvERJ1M7c5v4jJA6BjcEqfg89J+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NuEpe6D9vtju2zi5caO/QSjUV4lsptwksUFatD2c5sJ57T9lNhA0SeCRsTtqWHDfM AB6VwCOVTc/2+6HPHyvsivHV2PTBBwoHjfbOJ+d+IutkU6fKgp3l6fTIphkXOYz1BZ AeoiUxxcYoHOaGfkCj7+eBY55mqE4azb7mbHHHbVOUkF0YutvmNs/nw49UIwVs4U0n Y6us+NUjbtoeAPRVWNg5FVvlhNIAn+WWfVfj5DEVfkdp7m0/KKki95jVMnKkIVP75e Rjvv1Zo7REHfHSIWyDjpgUdLhzAiwohwxRFCUIejuwFh6U4uNOAeQFicCtisoruu29 yYCEhJRraee0w== From: SeongJae Park To: Barry Song <21cnbao@gmail.com> Cc: SeongJae Park , akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Barry Song , David Hildenbrand , Lance Yang , Ryan Roberts , Yin Fengwei Subject: Re: [PATCH v2] mm: make folio_pte_batch available outside of mm/memory.c Date: Tue, 27 Feb 2024 16:15:01 -0800 Message-Id: <20240228001501.160138-1-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Wed, 28 Feb 2024 13:10:06 +1300 Barry Song <21cnbao@gmail.com> wrote: > On Wed, Feb 28, 2024 at 10:54 AM SeongJae Park wrote: > > > > On Tue, 27 Feb 2024 23:42:01 +1300 Barry Song <21cnbao@gmail.com> wrote: > > > > > From: Barry Song > > > > > > madvise, mprotect and some others might need folio_pte_batch to check if > > > a range of PTEs are completely mapped to a large folio with contiguous > > > physical addresses. Let's make it available in mm/internal.h. > > > > Hi Barry, > > > > > > I found this patch makes some of my build test that not setting CONFIG_MMU > > fails with multiple errors including below: > > > > In file included from .../mm/nommu.c:43: > > .../mm/internal.h: In function '__pte_batch_clear_ignored': > > .../mm/internal.h:98:23: error: implicit declaration of function 'pte_mkclean'; did you mean 'page_mkclean'? [-Werror=implicit-function-declaration] > > 98 | pte = pte_mkclean(pte); > > | ^~~~~~~~~~~ > > | page_mkclean > > > > Enabling CONFIG_MMU made the build success. I haven't had a time to look into > > the code yet. May I ask your opinion? > > i guess it is because we have moved some func from memory.c to > headfile. and this headfile is included by lots of > files in mm. memory.c, for itself, will only be compiled with enabled > CONFIG_MMU: > mmu-$(CONFIG_MMU) := highmem.o memory.o mincore.o \ > mlock.o mmap.o mmu_gather.o mprotect.o mremap.o \ > msync.o page_vma_mapped.o pagewalk.o \ > pgtable-generic.o rmap.o vmalloc.o > > Does the below fix your build? > > diff --git a/mm/internal.h b/mm/internal.h > index fa9e2f7db506..4e57680b74e1 100644 > --- a/mm/internal.h > +++ b/mm/internal.h > @@ -83,6 +83,8 @@ static inline void *folio_raw_mapping(struct folio *folio) > return (void *)(mapping & ~PAGE_MAPPING_FLAGS); > } > > +#ifdef CONFIG_MMU > + > /* Flags for folio_pte_batch(). */ > typedef int __bitwise fpb_t; > > @@ -172,6 +174,7 @@ static inline int folio_pte_batch(struct folio > *folio, unsigned long addr, > > return min(ptep - start_ptep, max_nr); > } > +#endif /* CONFIG_MMU */ > > void __acct_reclaim_writeback(pg_data_t *pgdat, struct folio *folio, > int nr_throttled); Yes, applying the above diff fixed mine :) Thanks, SJ [...]