From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f72.google.com (mail-it0-f72.google.com [209.85.214.72]) by kanga.kvack.org (Postfix) with ESMTP id 990606B02F4 for ; Tue, 29 Aug 2017 15:16:51 -0400 (EDT) Received: by mail-it0-f72.google.com with SMTP id 190so4731700itx.7 for ; Tue, 29 Aug 2017 12:16:51 -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 64sor1617867ioc.159.2017.08.29.12.16.50 for (Google Transport Security); Tue, 29 Aug 2017 12:16:50 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20170829190526.8767-1-jglisse@redhat.com> From: Linus Torvalds Date: Tue, 29 Aug 2017 12:16:49 -0700 Message-ID: Subject: Re: [RFC PATCH] mm/rmap: do not call mmu_notifier_invalidate_page() v3 Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: To: =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= Cc: Linux Kernel Mailing List , linux-mm , Bernhard Held , Adam Borowski , Andrea Arcangeli , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Wanpeng Li , Paolo Bonzini , Takashi Iwai , Nadav Amit , Mike Galbraith , "Kirill A . Shutemov" , axie , Andrew Morton On Tue, Aug 29, 2017 at 12:09 PM, Linus Torvalds wrote: > > So any approach like this is fundamentally garbage. Really. Stop > sending crap. This is exactly tehe same thing that we already reverted > because it was broken shit. Why do you re-send it without actually > fixing the fundamental problems that were pointed out? Here's what I think might work: - put mmu_notifier_invalidate_range_start() before the rmap lock is taken (and yes, this means that you don't know if it actually will do anyhting) - put mmu_notifier_invalidate_range_end() after the lock is released. And yes, this means that it will be unconditional and regardless of whether anything happened) And then you can check if something actually happened by catching the *ATOMIC* call to mmu_notifier_invalidate_page(), setting a flag, and then doing something blocking at mmu_notifier_invalidate_range_end() time. Maybe. I don't know what the KVM issues are. Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org