Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp780571ybp; Fri, 4 Oct 2019 05:00:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyt8Pb6GuIWiJ4S1HPdHXLdi/BL9KONMIwRMujjL679XtuDe1WhCWvQtwjNN2BrbeB2s1ed X-Received: by 2002:a17:906:80c3:: with SMTP id a3mr11849387ejx.271.1570190431582; Fri, 04 Oct 2019 05:00:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570190431; cv=none; d=google.com; s=arc-20160816; b=akfRoAxCbZnARVDobUPl6KzmXGK3h3VN8tbI9SZ9VYU9Qa/hUQbzzrSsHCP/9oCVvy Mxqiu/e2/AawYJtCGVncyxWFlNkyu3dz8M8ZlH/Om9eIq3OAnuK6OUjVWB3nY8Z1xA9M gJGM6Nlne+xog8ugYNDBi7Y0hs2lROIHJRPE78x4JeUjYL0KRcXIb4fA/o4EP9WcI/OE unVs4u1L9hA1K1cAai0riGgUSGn3SJKb9uQp+5SKfJnRHfwuOjSGIi9sMOLY5o8punGO wboeQ7Bob3c+8Ox/QwxHfHO84ArqZyUvvoWAm4A0H/PRdzFRiwroC1AoxSyzCDl8bgG4 H5nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jWelrCDVOAXy8hN8VjR1adB6IyXBOt3/QtmJ/voDmTs=; b=wLH1XHmnQaQbVqB9Ee8hV3hmnJ+Dgu30Ks2U41msaej1qjMhpmMcXXNFF+BkDk92/X yh054G8y7rMmvjQ1Cwif9RkzonNmrVxsV/Y7w9iJkb78qf6ucn6mVXLdVqGbnLJCkFB0 1tU41zDtiFbWItTjI1p6CbjvSltQGpwX2nYw4gJVuyBxRaXchTH/feIqfhwk2KqwNL4j 50PFnNLwIib+oGRPnb1zeKuahj9lVDpqfeFOs0FREF225kg6Jwq8NhUToUoSfbMxjWII hYYMBt3Ce+VqBhBoVoED8WMutkZjoDx51K9CxwUlFrYjbn5AInUzHiFgRSuWSFanrJRT TBuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=nwkEEfEL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si2742647ejd.32.2019.10.04.05.00.06; Fri, 04 Oct 2019 05:00:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=nwkEEfEL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730040AbfJDLaA (ORCPT + 99 others); Fri, 4 Oct 2019 07:30:00 -0400 Received: from merlin.infradead.org ([205.233.59.134]:36116 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727254AbfJDLaA (ORCPT ); Fri, 4 Oct 2019 07:30:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jWelrCDVOAXy8hN8VjR1adB6IyXBOt3/QtmJ/voDmTs=; b=nwkEEfEL12BnVaYLSfPhd2e2Ln hB4i1gugq22rSMg1LCnlbu6Qno1BBRHFOYKFvZyD3L4tBd0085H+yAZ4MYaDWZ+eP9oY3o3MNjJjq BEhzcevGCSW20rEaS/5saCafPoGFWaV5v3eJouN5tEsfE5BvsGSyxBqt1fERyo/REimJh4LSRmyaD agnFLXltPj3p7qKpQ+/CtvR16C+KLJoJbaK2jrMk+LNGNWsTUGeC9qRmcCVlFJEUgAYK8Ay+xtxiS yUMpUi4BK+2/uOCdWIDdObYgY4555aqt6UZIbyTTrJBxLdCN8KfntKpA4qSjahlZ1BSiE8ZrmsiCl lZ0ESvGw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.2 #3 (Red Hat Linux)) id 1iGLlP-0005rP-Ht; Fri, 04 Oct 2019 11:28:47 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id DE8643013A4; Fri, 4 Oct 2019 13:27:54 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7BFF0203E50D2; Fri, 4 Oct 2019 13:28:44 +0200 (CEST) Date: Fri, 4 Oct 2019 13:28:44 +0200 From: Peter Zijlstra To: Leonardo Bras Cc: Song Liu , Michal Hocko , "Dmitry V. Levin" , Keith Busch , linux-mm@kvack.org, Paul Mackerras , Christoph Lameter , Ira Weiny , Dan Williams , Elena Reshetova , linux-arch@vger.kernel.org, Santosh Sivaraj , Davidlohr Bueso , "Aneesh Kumar K.V" , Bartlomiej Zolnierkiewicz , Mike Rapoport , Jason Gunthorpe , Vlastimil Babka , Mahesh Salgaonkar , Andrey Ryabinin , Alexey Dobriyan , Ingo Molnar , Andrea Arcangeli , Ralph Campbell , Arnd Bergmann , Jann Horn , John Hubbard , Jesper Dangaard Brouer , Nicholas Piggin , =?iso-8859-1?B?Suly9G1l?= Glisse , Mathieu Desnoyers , kvm-ppc@vger.kernel.org, Thomas Gleixner , Reza Arbab , Allison Randal , Christian Brauner , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Logan Gunthorpe , Souptick Joarder , Andrew Morton , linuxppc-dev@lists.ozlabs.org, Roman Gushchin , "Kirill A. Shutemov" , Al Viro Subject: Re: [PATCH v5 01/11] asm-generic/pgtable: Adds generic functions to monitor lockless pgtable walks Message-ID: <20191004112844.GC19463@hirez.programming.kicks-ass.net> References: <20191003013325.2614-1-leonardo@linux.ibm.com> <20191003013325.2614-2-leonardo@linux.ibm.com> <20191003071145.GM4536@hirez.programming.kicks-ass.net> <20191003115141.GJ4581@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 03, 2019 at 06:24:07PM -0300, Leonardo Bras wrote: > Hello Peter, thanks for the feedback! >=20 > On Thu, 2019-10-03 at 13:51 +0200, Peter Zijlstra wrote: > > On Thu, Oct 03, 2019 at 09:11:45AM +0200, Peter Zijlstra wrote: > > > On Wed, Oct 02, 2019 at 10:33:15PM -0300, Leonardo Bras wrote: > > > > diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pg= table.h > > > > index 818691846c90..3043ea9812d5 100644 > > > > --- a/include/asm-generic/pgtable.h > > > > +++ b/include/asm-generic/pgtable.h > > > > @@ -1171,6 +1171,64 @@ static inline bool arch_has_pfn_modify_check= (void) > > > > #endif > > > > #endif > > > > =20 > > > > +#ifndef __HAVE_ARCH_LOCKLESS_PGTBL_WALK_CONTROL > > > > +static inline unsigned long begin_lockless_pgtbl_walk(struct mm_st= ruct *mm) > > > > +{ > > > > + unsigned long irq_mask; > > > > + > > > > + if (IS_ENABLED(CONFIG_LOCKLESS_PAGE_TABLE_WALK_TRACKING)) > > > > + atomic_inc(&mm->lockless_pgtbl_walkers); > > >=20 > > > This will not work for file backed THP. Also, this is a fairly serious > > > contention point all on its own. > >=20 > > Kiryl says we have tmpfs-thp, this would be broken vs that, as would > > your (PowerPC) use of mm_cpumask() for that IPI. >=20 > Could you please explain it? > I mean, why this breaks tmpfs-thp? > Also, why mm_cpumask() is also broken? Because shared pages are not bound by a mm; or does it not share the thp state between mappings? > > And I still think all that wrong, you really shouldn't need to wait on > > munmap(). >=20 > That is something I need to better understand. I mean, before coming > with this patch, I thought exactly this: not serialize when on munmap.=20 >=20 > But on the way I was convinced it would not work on munmap. I need to > recall why, and if it was false to assume this, re-think the whole > solution. And once you (re)figure it out, please write it down. It is a crucial bit of the puzzle and needs to be part of the Changelogs.