From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751555AbdH2U7i (ORCPT ); Tue, 29 Aug 2017 16:59:38 -0400 Received: from mail-it0-f49.google.com ([209.85.214.49]:35945 "EHLO mail-it0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751240AbdH2U7h (ORCPT ); Tue, 29 Aug 2017 16:59:37 -0400 MIME-Version: 1.0 In-Reply-To: <20170829204901.GC13559@redhat.com> References: <0dcca3a4-8ecd-0d05-489c-7f6d1ddb49a6@gmx.de> <79BC5306-4ED4-41E4-B2C1-12197D9D1709@gmail.com> <20170829125923.g3tp22bzsrcuruks@angband.pl> <20170829140924.GB21615@redhat.com> <20170829183405.GB7546@redhat.com> <20170829191351.GD7546@redhat.com> <20170829204901.GC13559@redhat.com> From: Linus Torvalds Date: Tue, 29 Aug 2017 13:59:35 -0700 X-Google-Sender-Auth: 1-pMqhi_RkzltewoUucp591q4F0 Message-ID: Subject: Re: kvm splat in mmu_spte_clear_track_bits To: Andrea Arcangeli Cc: Jerome Glisse , Adam Borowski , Takashi Iwai , Bernhard Held , Nadav Amit , Paolo Bonzini , Wanpeng Li , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Joerg Roedel , "Kirill A. Shutemov" , Andrew Morton , kvm , "linux-kernel@vger.kernel.org" , Michal Hocko Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 29, 2017 at 1:49 PM, Andrea Arcangeli wrote: > > mmu_notifier_invalidate_page has the advantage that it takes the > secondary MMU KVM srcu and spinlock a single time. Note that that isn't actually all that much of an advantage - it turns out that a lot of users have "range_start", but not "range_end". So in a lot of cases, the "range_start/end()" seems to be exactly as expensive as just the single "page()" call, simply because the code didn't really need the whole range, it only wanted to make sure it was invalidating its data before the range got modified. KVM ends up doing a partial case of that optimization too: it doesn't do the srcu lock in the end case, for example. It does want to keep the sequence numbers for the end case, but that's fairly cheap. So I'd much rather have the simpler rules than have duplicated interfaces for some very dubious performance advantage. Linus