Received: by 10.192.165.156 with SMTP id m28csp602101imm; Fri, 13 Apr 2018 04:51:34 -0700 (PDT) X-Google-Smtp-Source: AIpwx49aoKikSC4SkqfQQ9+NOqZlu8Y9MTOTz4KY88z1EIKfdSH968WxzyHoZQ+IaL8cEnSojaWN X-Received: by 10.98.60.146 with SMTP id b18mr11381662pfk.36.1523620294487; Fri, 13 Apr 2018 04:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523620294; cv=none; d=google.com; s=arc-20160816; b=XxS0wC6IYxPVjA5XPPeC03RYVIyDUDUC8QkEZSMm5oCLFBCpcGOP5vsC4dSPsegaSp NPVb3Bs7Lp/8ovbpRbZGYcGkRuzQYxbelbB7jTRVSCDz5D6WH85Y6AL3KQEv6IVdAbcV DJ1Jq6L/dAEKuqlWQ/WILvzBTMJ/rFaC163rWd27bzUil8ZAFNqEw/9kAwMzmKTtLitK SKNYByIU8hu7IWuVXzedkvTzLUjY/dFZOVSBK1BoPS7KdURIrZ+NOO145rj6bGEilVdJ 6KghcnE3qhZASwyetWYDiqxBvbCmEy8bG+WUQ2Pt2vQsdFZSQJUHUTQMGMt+rhrBjAw3 JmDQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=KaBU2Dsc1PgqIAA3pZzOUXHagw5y0JZV+7izoNaDNMg=; b=m6CpOWDi4gBEOA0R6NifBcQgIDDjZ6PbRnBMfpDsa6sTUa8SN2Qt0DwrRIPAFDHQDC JJjYdqRCqybV8oMUbZvkEwyGz/215UhC26FU89C1r1JFAiIUUwy8or09go2XhOXURKPz x+YCgWawKIMwAiK9N2zWcPUPRwSdnWr55PDpSQF4v/shlpPjNa7sTZ0/vP1nkQ5qUUzb QWgE+Kc12QcQ96vERUx2jKCSfHhAwoxmNTH5roNH9pcKOCAO7UNvsWd83Hvy0jMKHrAM k8V+LBgjMYvGeeG6iOZBZIQBGCM5JjKjZsFkY+JEfxZPv+QREFmdRj9XTe1r4hqhZGns pWqQ== ARC-Authentication-Results: i=1; mx.google.com; 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 m63si4022931pgm.302.2018.04.13.04.51.20; Fri, 13 Apr 2018 04:51:34 -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; 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 S1754339AbeDMLJz (ORCPT + 99 others); Fri, 13 Apr 2018 07:09:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:37844 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754323AbeDMLJy (ORCPT ); Fri, 13 Apr 2018 07:09:54 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4D0CFACB8; Fri, 13 Apr 2018 11:09:52 +0000 (UTC) Date: Fri, 13 Apr 2018 13:09:49 +0200 From: Michal Hocko To: Chintan Pandya Cc: Anshuman Khandual , vbabka@suse.cz, labbott@redhat.com, catalin.marinas@arm.com, hannes@cmpxchg.org, f.fainelli@gmail.com, xieyisheng1@huawei.com, ard.biesheuvel@linaro.org, richard.weiyang@gmail.com, byungchul.park@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: vmalloc: Remove double execution of vunmap_page_range Message-ID: <20180413110949.GA17670@dhcp22.suse.cz> References: <1523611019-17679-1-git-send-email-cpandya@codeaurora.org> <8da9f826-2a3d-e618-e512-4fc8d45c16f2@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 13-04-18 16:15:26, Chintan Pandya wrote: > > > On 4/13/2018 4:10 PM, Anshuman Khandual wrote: > > On 04/13/2018 03:47 PM, Chintan Pandya wrote: > > > > > > > > > On 4/13/2018 3:29 PM, Anshuman Khandual wrote: > > > > On 04/13/2018 02:46 PM, Chintan Pandya wrote: > > > > > Unmap legs do call vunmap_page_range() irrespective of > > > > > debug_pagealloc_enabled() is enabled or not. So, remove > > > > > redundant check and optional vunmap_page_range() routines. > > > > > > > > vunmap_page_range() tears down the page table entries and does > > > > not really flush related TLB entries normally unless page alloc > > > > debug is enabled where it wants to make sure no stale mapping is > > > > still around for debug purpose. Deferring TLB flush improves > > > > performance. This patch will force TLB flush during each page > > > > table tear down and hence not desirable. > > > > > > > Deferred TLB invalidation will surely improve performance. But force > > > flush can help in detecting invalid access right then and there. I > > > > Deferred TLB invalidation was a choice made some time ago with the > > commit db64fe02258f1507e ("mm: rewrite vmap layer") as these vmalloc > > mappings wont be used other than inside the kernel and TLB gets > > flushed when they are reused. This way it can still avail the benefit > > of deferred TLB flushing without exposing itself to invalid accesses. > > > > > chose later. May be I should have clean up the vmap tear down code > > > as well where it actually does the TLB invalidation. > > > > > > Or make TLB invalidation in free_unmap_vmap_area() be dependent upon > > > debug_pagealloc_enabled(). > > > > Immediate TLB invalidation needs to be dependent on debug_pagealloc_ > > enabled() and should be done only for debug purpose. Contrary to that > > is not desirable. > > > Okay. I will raise v2 for that. More importantly. Your changelog absolutely lacks the _why_ part. It just states what the code does which is not all that hard to read from the diff. It is usually much more important to present _why_ the patch is an improvement and worth merging. -- Michal Hocko SUSE Labs