From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by kanga.kvack.org (Postfix) with ESMTP id 83BE46B0003 for ; Wed, 1 Aug 2018 17:25:25 -0400 (EDT) Received: by mail-pf1-f197.google.com with SMTP id p5-v6so33986pfh.11 for ; Wed, 01 Aug 2018 14:25:25 -0700 (PDT) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id f191-v6sor7329pfc.144.2018.08.01.14.25.24 for (Google Transport Security); Wed, 01 Aug 2018 14:25:24 -0700 (PDT) Date: Thu, 2 Aug 2018 00:25:18 +0300 From: "Kirill A. Shutemov" Subject: Re: Linux 4.18-rc7 Message-ID: <20180801212518.jjdwf53p3sj4b455@kshutemo-mobl1> References: <20180731170328.ocb5oikwhwtkyzrj@kshutemo-mobl1> <20180731174349.GA12944@agluck-desk> <20180801205156.zv45fcveexwa2dqs@kshutemo-mobl1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Linus Torvalds Cc: Tony Luck , Amit Pundir , John Stultz , Hugh Dickins , Matthew Wilcox , "Kirill A. Shutemov" , Andrew Morton , Dmitry Vyukov , Oleg Nesterov , Andrea Arcangeli , Greg Kroah-Hartman , linux-mm , Linux Kernel Mailing List , youling 257 , Joel Fernandes , Colin Cross On Wed, Aug 01, 2018 at 01:56:19PM -0700, Linus Torvalds wrote: > On Wed, Aug 1, 2018 at 1:52 PM Kirill A. Shutemov wrote: > > > > Is there a reason why we pass vma to flush_tlb_range? > > Yes. It's even in that patch. > > The fact is, real MM users *have* a vma, and passing it in to the TLB > flushing is the right thing to do. That allows architectures that care > (mainly powerpc, I think) to notice that "hey, this range only had > execute permissions, so I only need to flush the ITLB". > > The people who use tlb_flush_range() any other way are doing an > arch-specific hack. It's not how tlb_flush_range() was defined, and > it's not how you can use it in general. Okay, I see. ARM, unicore32 and xtensa avoid iTLB flush for non-executable VMAs. > > > It's not obvious to me what information from VMA can be useful for an > > implementation. > > See the patch I sent, which had this as part of it: > > - * XXX fix me: flush_tlb_range() should take an mm > pointer instead of a > - * vma pointer. > + * flush_tlb_range() takes a vma instead of a mm pointer because > + * some architectures want the vm_flags for ITLB/DTLB flush. > > because I wanted to educate people about why the interface was what it > was, and the "fixme" was bogus shit. I didn't noticied this. Sorry. -- Kirill A. Shutemov