From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f69.google.com (mail-it0-f69.google.com [209.85.214.69]) by kanga.kvack.org (Postfix) with ESMTP id DC89E6B0006 for ; Wed, 1 Aug 2018 16:56:31 -0400 (EDT) Received: by mail-it0-f69.google.com with SMTP id r184-v6so100038ith.0 for ; Wed, 01 Aug 2018 13:56:31 -0700 (PDT) Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id h6-v6sor3770448ioq.55.2018.08.01.13.56.30 for (Google Transport Security); Wed, 01 Aug 2018 13:56:30 -0700 (PDT) MIME-Version: 1.0 References: <20180731170328.ocb5oikwhwtkyzrj@kshutemo-mobl1> <20180731174349.GA12944@agluck-desk> <20180801205156.zv45fcveexwa2dqs@kshutemo-mobl1> In-Reply-To: <20180801205156.zv45fcveexwa2dqs@kshutemo-mobl1> From: Linus Torvalds Date: Wed, 1 Aug 2018 13:56:19 -0700 Message-ID: Subject: Re: Linux 4.18-rc7 Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: "Kirill A. Shutemov" 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 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. > 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. > In longer term we can change the interface to take mm instead of vma. FUCK NO! Goddammit, read the code, or read the patch. The places ytou added those broken vma_init() calls to were architecture-specific hacks. Those architecture-specific hacks do not get to screw up the design for everybody else. Linus