From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Tony Luck <tony.luck@intel.com>,
Amit Pundir <amit.pundir@linaro.org>,
John Stultz <john.stultz@linaro.org>,
Hugh Dickins <hughd@google.com>,
Matthew Wilcox <willy@infradead.org>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Dmitry Vyukov <dvyukov@google.com>,
Oleg Nesterov <oleg@redhat.com>,
Andrea Arcangeli <aarcange@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-mm <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
youling 257 <youling257@gmail.com>,
Joel Fernandes <joelaf@google.com>,
Colin Cross <ccross@google.com>
Subject: Re: Linux 4.18-rc7
Date: Wed, 1 Aug 2018 23:51:56 +0300 [thread overview]
Message-ID: <20180801205156.zv45fcveexwa2dqs@kshutemo-mobl1> (raw)
In-Reply-To: <CA+55aFz0eKks=v872LA-tDx4qcmBtxTYXbeztZcWbgx6SeQHNg@mail.gmail.com>
On Wed, Aug 01, 2018 at 01:05:48PM -0700, Linus Torvalds wrote:
> On Wed, Aug 1, 2018 at 10:15 AM Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > I'm still unhappy about the vma_init() ones, and I have not decided
> > how to go with those. Either the memset() in vma_init(), or just
> > reverting the (imho unnecessary) commit 2c4541e24c55. Kirill, Andrew,
> > comments?
>
> Ugh. Adding a memset looks simple, but screws up some places that have
> other initialization. It also requires adding a new include of
> <linux/string.h>, or we'd need to uninline vma_init() and put it
> somewhere else.
>
> But just reverting commit 2c4541e24c55 ("mm: use vma_init() to
> initialize VMAs on stack and data segments") entirely isn't good
> either, because some of the cases aren't about the TLB flush
> interface, and call down to "real" VM functions. The 'pseudo_vma' use
> of remove_inode_hugepages() and hugetlbfs_fallocate() in particular is
> odd, but using vma_init() looks good there. And those places had the
> memset() already.
>
> So I'm inclined to simply mark the TLB-related vma_init() cases
> special, and use something like this:
>
> #define TLB_FLUSH_VMA(mm,flags) { .vm_mm = (mm), .vm_flags = (flags) }
>
> to make it very obvious when we're doing that vma initialization for
> flush_tlb_range(). It's done as an initializer, exactly so that the
> only valid syntax is to do somethin glike this:
>
> struct vm_area_struct vma = TLB_FLUSH_VMA(mm, VM_EXEC);
>
> That leaves vma_init() users to be just the actual real allocation
> path, and a few very specific specual vmas (the hugetlbfs and
> mempolicy pseudo-vma, and a couple of "gate" vmas).
>
> Suggested patch attached. Comments?
Is there a reason why we pass vma to flush_tlb_range?
It's not obvious to me what information from VMA can be useful for an
implementation. I see that ecard.c initialize vm_flags too, but it seems
unused by flush_tlb_range.
Maybe it's cleaner to have generic helper flush_tlb_range_mm() or
something?
In longer term we can change the interface to take mm instead of vma.
--
Kirill A. Shutemov
next prev parent reply other threads:[~2018-08-01 20:52 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CA+55aFxpFefwVdTGVML99PSFUqwpJXPx5LVCA3D=g2t2_QLNsA@mail.gmail.com>
2018-07-30 6:47 ` Amit Pundir
2018-07-30 13:01 ` Kirill A. Shutemov
2018-07-30 13:34 ` Amit Pundir
2018-07-30 17:32 ` Linus Torvalds
2018-07-30 21:53 ` Hugh Dickins
2018-07-31 1:01 ` Linus Torvalds
2018-07-31 3:26 ` Hugh Dickins
2018-07-31 4:25 ` John Stultz
2018-07-31 6:40 ` Amit Pundir
2018-07-31 6:56 ` Kirill A. Shutemov
2018-07-31 16:29 ` Linus Torvalds
2018-07-31 16:56 ` John Stultz
2018-07-31 17:03 ` Kirill A. Shutemov
2018-07-31 17:43 ` Luck, Tony
2018-07-31 19:02 ` Linus Torvalds
2018-08-01 17:15 ` Linus Torvalds
2018-08-01 18:31 ` Hugh Dickins
2018-08-01 20:58 ` Kirill A. Shutemov
2018-08-01 21:55 ` Hugh Dickins
2018-08-02 19:12 ` John Stultz
2018-08-01 18:36 ` Luck, Tony
2018-08-01 20:05 ` Linus Torvalds
2018-08-01 20:51 ` Kirill A. Shutemov [this message]
2018-08-01 20:56 ` Linus Torvalds
2018-08-01 21:25 ` Kirill A. Shutemov
2018-08-02 6:59 ` Amit Pundir
2018-07-31 17:17 ` [PATCH] staging: ashmem: Fix SIGBUS crash when traversing mmaped ashmem pages John Stultz
2018-07-31 22:57 ` Linux 4.18-rc7 youling 257
2018-07-31 23:07 ` youling 257
2018-07-31 6:29 ` Kirill A. Shutemov
2018-07-31 14:57 ` Kirill A. Shutemov
2018-08-01 0:09 ` Hugh Dickins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180801205156.zv45fcveexwa2dqs@kshutemo-mobl1 \
--to=kirill@shutemov.name \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=amit.pundir@linaro.org \
--cc=ccross@google.com \
--cc=dvyukov@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=hughd@google.com \
--cc=joelaf@google.com \
--cc=john.stultz@linaro.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=oleg@redhat.com \
--cc=tony.luck@intel.com \
--cc=torvalds@linux-foundation.org \
--cc=willy@infradead.org \
--cc=youling257@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox