From: David Hildenbrand Subject: Re: [PATCH v2] KVM: s390: vsie: use common code functions for pinning Date: Thu, 28 Sep 2017 18:53:14 +0200 Message-ID: <8ee4e954-7668-9a75-c071-bf7fb04ff62e@redhat.com> References: <20170901151143.22714-1-david@redhat.com> <87e03f5e-3f26-2ff1-b9c5-13ce28a4365a@de.ibm.com> <3f22bb1a-456c-d616-a4f3-229b3b14fb4c@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Cornelia Huck To: Christian Borntraeger , kvm@vger.kernel.org, Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44808 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751580AbdI1QxQ (ORCPT ); Thu, 28 Sep 2017 12:53:16 -0400 In-Reply-To: <3f22bb1a-456c-d616-a4f3-229b3b14fb4c@redhat.com> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: Ping Paolo :) >> This is probably ok but can you maybe outline why we no longer need the >> _lock variant of set_page_dirty? (Or asked differently: why did we use >> the _locked varaint) >> >> Other than that everything looks sane, I am just not sure about this part. >> > > Short answer: As x86 uses this heavily, I was expecting it to do the > right thing. I can't sport any additional page locking in x86 code. > > Long answer: > > mm/page-writeback.c: It only seems to be relevant for !anonymous mappings. > > "set_page_dirty() is racy [...] This is because another CPU could > truncate the page off the mapping and then free the mapping." > > "For pages with a mapping this should be done under the page lock for > the benefit of asynchronous memory errors who prefer a consistent dirty > state. This rule can be broken in some special cases [...]" > > Sounds to me like the worst thing that could happen is losing a dirty > flag. Which should not matter if somebody tries to do nasty stuff with > the mapping either way. > > > But to verify: Paolo, can you recall why we don't need the _locked > variants in kvm common code? > -- Thanks, David