From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B89EC48BE8 for ; Mon, 14 Jun 2021 07:04:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DF56961370 for ; Mon, 14 Jun 2021 07:04:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF56961370 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=lespinasse.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 604226B006C; Mon, 14 Jun 2021 03:04:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5DB386B006E; Mon, 14 Jun 2021 03:04:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 47C946B0070; Mon, 14 Jun 2021 03:04:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id 17B966B006C for ; Mon, 14 Jun 2021 03:04:44 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id AE9866139 for ; Mon, 14 Jun 2021 07:04:43 +0000 (UTC) X-FDA: 78251441646.08.4537587 Received: from server.lespinasse.org (server.lespinasse.org [63.205.204.226]) by imf25.hostedemail.com (Postfix) with ESMTP id 6909A600014E for ; Mon, 14 Jun 2021 07:04:35 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-20-ed; t=1623654281; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=3AVCNhIvo4M95EhB7FF7RNyXT3JEJVpODvygh/r6OPk=; b=PXivVQW6eWktfGyI+mumqLmTQvM4bULsbFVL4aNk922OK+Xt32PFAy6wj6Kxlmgjs6Lk2 JpAlgpU80zOjWhlBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-20-rsa; t=1623654281; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=3AVCNhIvo4M95EhB7FF7RNyXT3JEJVpODvygh/r6OPk=; b=j4iXVr63U9HucLWMaX9nnYgHq2M/Pa09hNOMAA3OQFPon1KUED0sfM5uXtUcVStdUkXCT hGtL/lY1ZbnObVuLGtzYBc/VihWO9ua7B/9Lvh8Qt1QkeIrV2qHm1AnAdRu7+mi4/caLQcp DJpxEAEIMu2PyuEelywNZU7+gzLCxG+m/trleT//8+86CG8L52GAZdJ9uNiic8pkcFWsLEY nB7v8N1lI8riKetb2FzCw1PzfWnxIuiW++eKiI6iUrRguUsFpbiDOt/DnWoj1B5KgGYLNTQ wiJl5AjGe5sX+sozTDChtIJ55lP4OtEtihGjNqdXK2nAJ6Axgx0Ch1YvBExg== Received: by server.lespinasse.org (Postfix, from userid 1000) id 126EF160897; Mon, 14 Jun 2021 00:04:41 -0700 (PDT) Date: Mon, 14 Jun 2021 00:04:41 -0700 From: Michel Lespinasse To: Suren Baghdasaryan Cc: "Paul E . McKenney" , Michel Lespinasse , Linux-MM , Linux-Kernel , Laurent Dufour , Peter Zijlstra , Michal Hocko , Matthew Wilcox , Rik van Riel , Andrew Morton , Joel Fernandes , Andy Lutomirski Subject: Re: [PATCH 00/29] Speculative page faults (anon vmas only) Message-ID: <20210614070441.GA3801@lespinasse.org> References: <20210430195232.30491-1-michel@lespinasse.org> <20210430224649.GA29203@lespinasse.org> <20210503181118.GA21048@lespinasse.org> <20210517175750.GJ4441@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=lespinasse.org header.s=srv-20-ed header.b=PXivVQW6; dkim=pass header.d=lespinasse.org header.s=srv-20-rsa header.b=j4iXVr63; dmarc=pass (policy=none) header.from=lespinasse.org; spf=pass (imf25.hostedemail.com: domain of michel@lespinasse.org designates 63.205.204.226 as permitted sender) smtp.mailfrom=michel@lespinasse.org X-Stat-Signature: ofji9z5b5octejw3gec8d3nknjdcr3m7 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 6909A600014E X-HE-Tag: 1623654275-508698 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: On Thu, May 20, 2021 at 03:10:24PM -0700, Suren Baghdasaryan wrote: > Hi Paul, > I promised you to look into this but somehow forgot to reply, sorry > about that. The issue is the new "#include " in mm.h > which causes page_pgdat() usage before it is defined: Yes. This only happens in non-memcg configs, which is why I hadn't found it in testing. > > mm.h includes mm_types.h > mm_types.h includes vmstat.h > vmstat.h uses page_pgdat() > mm.h defines page_pgdat() > > Not sure if this is the best way to fix it but this worked fine for me: > > --- > include/linux/mmap_lock.h | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/include/linux/mmap_lock.h b/include/linux/mmap_lock.h > index 98f24a9910a9..13d4a706c0eb 100644 > --- a/include/linux/mmap_lock.h > +++ b/include/linux/mmap_lock.h > @@ -7,7 +7,7 @@ > #include > #include > #include > -#include > +#include > > #ifdef CONFIG_SPECULATIVE_PAGE_FAULT > #define MMAP_LOCK_SEQ_INITIALIZER(name) \ > @@ -113,6 +113,8 @@ static inline bool __mmap_seq_read_check(struct > mm_struct *mm, > } > > #ifdef CONFIG_SPECULATIVE_PAGE_FAULT_STATS > +static inline void count_vm_event(enum vm_event_item item); > + > static inline bool mmap_seq_read_check(struct mm_struct *mm, unsigned long seq, > enum vm_event_item fail_event) > { I think having only the count_vm_event() prototype may cause it to not actually get inlined when we want it ? I think it would be ideal to have a separate linux/vm_event.h header, with just the definitions that are currently in linux/vmstat.h between "#ifdef CONFIG_VM_EVENT_COUNTERS" and up to (and including) the __count_vm_events() definition (i.e., functions that just increment the percpu event counters). Then mmap_lock.h could use that instead of the full vmstat.h. -- Michel "walken" Lespinasse