From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [PATCH 3/6] mmu_notifier: add event information to address invalidation v2 Date: Mon, 30 Jun 2014 18:57:25 -0700 Message-ID: References: <1403920822-14488-1-git-send-email-j.glisse@gmail.com> <1403920822-14488-4-git-send-email-j.glisse@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <1403920822-14488-4-git-send-email-j.glisse@gmail.com> Sender: linux-kernel-owner@vger.kernel.org To: =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= Cc: Andrew Morton , linux-mm , Linux Kernel Mailing List , Mel Gorman , Peter Anvin , peterz@infraread.org, Andrea Arcangeli , Rik van Riel , Johannes Weiner , Mark Hairgrove , Jatin Kumar , Subhash Gutti , Lucien Dunning , Cameron Buschardt , Arvind Gopalakrishnan , John Hubbard , Sherry Cheung , Duncan Poole , Oded Gabbay , Alexander Deucher , Andrew Lewycky , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= List-Id: linux-mm.kvack.org On Fri, Jun 27, 2014 at 7:00 PM, J=C3=A9r=C3=B4me Glisse wrote: > From: J=C3=A9r=C3=B4me Glisse > > The event information will be useful [...] That needs to be cleaned up, though. Why the heck are you making up ew and stupid event types? Now you make the generic VM code do stupid things like this: + if ((vma->vm_flags & VM_READ) && (vma->vm_flags & VM_WRITE)) + event =3D MMU_MPROT_RANDW; + else if (vma->vm_flags & VM_WRITE) + event =3D MMU_MPROT_WONLY; + else if (vma->vm_flags & VM_READ) + event =3D MMU_MPROT_RONLY; which makes no sense at all. The names are some horrible abortion too ("RANDW"? That sounds like "random write" to me, not "read-and-write", which is commonly shortened RW or perhaps RDWR. Same foes for RONLY/WONLY - what kind of crazy names are those? But more importantly, afaik none of that is needed. Instead, tell us why you need particular flags, and don't make up crazy names like this. As far as I can tell, you're already passing in the new protection information (thanks to passing in the vma), so all those badly named states you've made up seem to be totally pointless. They add no actual information, but they *do* add crazy code like the above to generic code that doesn't even WANT any of this crap. The only thing this should need is a MMU_MPROT event, and just use that. Then anybody who wants to look at whether the protections are being changed to read-only, they can just look at the vma->vm_flags themselves. So things like this need to be tightened up and made sane before any chance of merging it. So NAK NAK NAK in the meantime. Linus