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=-5.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 38291C35247 for ; Sun, 26 Jan 2020 15:52:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C5F9520720 for ; Sun, 26 Jan 2020 15:52:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HNRIG9gV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5F9520720 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3780F6B0005; Sun, 26 Jan 2020 10:52:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 300A06B0006; Sun, 26 Jan 2020 10:52:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1C9136B0007; Sun, 26 Jan 2020 10:52:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id 0410B6B0005 for ; Sun, 26 Jan 2020 10:52:08 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id B94E5180AD806 for ; Sun, 26 Jan 2020 15:52:08 +0000 (UTC) X-FDA: 76420226736.16.ducks36_8716b8318900e X-HE-Tag: ducks36_8716b8318900e X-Filterd-Recvd-Size: 4952 Received: from mail-yw1-f68.google.com (mail-yw1-f68.google.com [209.85.161.68]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Sun, 26 Jan 2020 15:52:08 +0000 (UTC) Received: by mail-yw1-f68.google.com with SMTP id b186so3575526ywc.1 for ; Sun, 26 Jan 2020 07:52:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xPQePlZh39eyKR7YsKEWuSikwFjI98oXqirYgx30KXE=; b=HNRIG9gVkQ3HUI1aPRe0Ivt5iFSUUZFFylghPFPTkVk2EbRf19u2ShlE9/wu5pBwiN nnLK9198pwYtX+EyZs4aN66WVjIgyvGGXcCa/DSAuUC4SrsnozONNhVL+vvCOv5BaE23 urdIWh7Ris7cyshQDk/G2CFEXaViQgIVHoWNLr6mnSjIDVraPpkNy0mnPVwvC+c9MeLY VH6U2f6qn5522b0SbKQxxawcy15GO9rOnuyFVxebv/oELdanZErlbZlKgThLcSoabekU +9/gaKn4ndfK9uTcww9m5dYeoG+Oy7NA2gFe6eCTOpXM7l4rYY7bt0AtgkycAxY/fKBp XfUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=xPQePlZh39eyKR7YsKEWuSikwFjI98oXqirYgx30KXE=; b=prO6tuAsv043hhF1DvnUAw20XiCeuVPZrVVyTuL0ZCxAM6Wg7KTHkbld1alztGStSd vn/WRwgib2YNp0FEmklbfMON8HNEc16qOTjYZYEOaljC8KUMYx3NjSCCtbiyz85aF0hQ XcdYIG37AEBEjAsP64rOASH4MVXpaywZfb0EuOL+j53KM/UZWcy0iHe6/uoCLjIStEdc RxHVz2CjzFYiKN/6xnuMpMo0ouoB/KR3ubEKbaMTv3MBZjRTjaKIuXCS+aIjSpwNRvw5 scC6rMkcOh7YdZuOObXc/IYRI+/NSMMYcwejhXJu4aLl/eA5Yy8vtWae6ydqp8ho2CL4 C6QA== X-Gm-Message-State: APjAAAXDmsopObEjzzxr9yxb9/Fudowyk4Cyg0udAMzxNtZoXILBxUl0 zMzkqyJ9qb66IIeqiAotFeM= X-Google-Smtp-Source: APXvYqzQYT+W6XCbUawf7R1JSNBQ+6MKFwmNzKeWZ41jpyb77P5GUPE3Qx4ZKz13C1trK05wq5bseA== X-Received: by 2002:a0d:c905:: with SMTP id l5mr8579692ywd.44.1580053927628; Sun, 26 Jan 2020 07:52:07 -0800 (PST) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id i17sm5364260ywg.66.2020.01.26.07.52.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Jan 2020 07:52:07 -0800 (PST) Date: Sun, 26 Jan 2020 07:52:05 -0800 From: Guenter Roeck To: Peter Zijlstra Cc: Will Deacon , "Aneesh Kumar K.V" , Andrew Morton , Nick Piggin , linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yoshinori Sato , Rich Felker , "David S. Miller" , Helge Deller , Geert Uytterhoeven , Paul Burton , Tony Luck , Richard Henderson , Nick Hu , Paul Walmsley Subject: Re: [PATCH mk-II 08/17] asm-generic/tlb: Provide MMU_GATHER_TABLE_FREE Message-ID: <20200126155205.GA19169@roeck-us.net> References: <20191211120713.360281197@infradead.org> <20191211122956.112607298@infradead.org> <20191212093205.GU2827@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191212093205.GU2827@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.9.4 (2018-02-28) 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, Dec 12, 2019 at 10:32:05AM +0100, Peter Zijlstra wrote: > As described in the comment, the correct order for freeing pages is: > > 1) unhook page > 2) TLB invalidate page > 3) free page > > This order equally applies to page directories. > > Currently there are two correct options: > > - use tlb_remove_page(), when all page directores are full pages and > there are no futher contraints placed by things like software > walkers (HAVE_FAST_GUP). > > - use MMU_GATHER_RCU_TABLE_FREE and tlb_remove_table() when the > architecture does not do IPI based TLB invalidate and has > HAVE_FAST_GUP (or software TLB fill). > > This however leaves architectures that don't have page based > directories but don't need RCU in a bind. For those, provide > MMU_GATHER_TABLE_FREE, which provides the independent batching for > directories without the additional RCU freeing. > > Signed-off-by: Peter Zijlstra (Intel) > --- Various sparc64 builds (allnoconfig, tinyconfig, as well as builds with SMP disabled): mm/mmu_gather.c: In function '__tlb_remove_table_free': mm/mmu_gather.c:101:3: error: implicit declaration of function '__tlb_remove_table'; did you mean 'tlb_remove_table'? Guenter