Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2519595pxj; Mon, 14 Jun 2021 00:06:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsLSDCg+qWovmLWstwMg+lndJBn0Jbk9YFuYYpK5DUSYwTWEgj5IGrs1CnO8hf+QkM1A3K X-Received: by 2002:a05:6402:520f:: with SMTP id s15mr15637016edd.125.1623654413562; Mon, 14 Jun 2021 00:06:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623654413; cv=none; d=google.com; s=arc-20160816; b=wP/7rRTIeiksLBgGS7RXdDDO8gkvm1DgoWDJcLD/hRa/8rRUNEsKSqSgLTW6cd7NFQ Kt3jXXV8R8/8+KvyvUzALhNOAyH5Q0P2BtQYuxJTPjk4rfXe7B8Q45FuGyfvm5nlCStg BvJ6v6AlF/0ed8qZNzQFWMUINPHDVF8++Z+SG6LHk+8c06FnaDbG43eL8k8oRJ3xdrHn UX1UqNnhtKZTj0DdB4+GS62yOs3zb7BKqAxRCx0r9Ib/6Z4ktdb+zDKJlhXgfzXogfJy Yh8V7w2biVVxqSUGsIfGaYOSC2TP3nM5dF11xxBoB0bJFrGLeUWk4kVmyfZxcjSRM5ki o5pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=3AVCNhIvo4M95EhB7FF7RNyXT3JEJVpODvygh/r6OPk=; b=S7HA+51ps1tkz5lB3FXzzlnZ2ViUN3d0FWL4ufjBKADW1nEEYdRqdJb1AfPOuOOyza 7B0IX80YdJ0A1Xu4jX1ChC0qbQDdnXgbaNLUCNAYrt22/7N44zy4/AXrJ4lRVXrU1Je+ 6lX2ILIQvqzteS1NEAohSgw3zpWa8Hefexia+AceZhV+Hv2lPJNnPFtCki6G+YIFB5yA E9WPnTCsbB8L2KKgHMeBDZBuOp5BiN6aljmqu37e3kr5Vg0GV81tha3SeHoXCciGFETQ v04oCtkG12jN5iHjhkGuL6AnVJ3v4gjmT0GF/JTkXkUGYylPiYHV65eRvdbOr9yAkaF1 XpsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org header.s=srv-20-ed header.b=PXivVQW6; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-20-rsa header.b=j4iXVr63; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lespinasse.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kq12si12878839ejb.67.2021.06.14.00.06.30; Mon, 14 Jun 2021 00:06:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org header.s=srv-20-ed header.b=PXivVQW6; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-20-rsa header.b=j4iXVr63; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lespinasse.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232384AbhFNHGo (ORCPT + 99 others); Mon, 14 Jun 2021 03:06:44 -0400 Received: from server.lespinasse.org ([63.205.204.226]:34919 "EHLO server.lespinasse.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232096AbhFNHGo (ORCPT ); Mon, 14 Jun 2021 03:06:44 -0400 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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