Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp541392imm; Fri, 22 Jun 2018 00:44:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLEUfSIKfk5KuYKPci+6IRxEvThWbzATWIu9NdB4UgwSidBvC/wHKiSzn3xdqUiHJ2z4PxK X-Received: by 2002:a63:6ecd:: with SMTP id j196-v6mr466211pgc.12.1529653446496; Fri, 22 Jun 2018 00:44:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529653446; cv=none; d=google.com; s=arc-20160816; b=yNDz0uLGrMjHVQoTeqjSJmDSTb883Y9vztJTngvp9WnHkQBZNiAlL3YIXsUSraGqLj Qb1a6b/S4uLEa2WF+jpfZ6HZi9AojPGXSmbvAfK3FSTzF0IuQEmH25yHLRJgNSPywjnX jKrPB2UCg0etAM1qsa02YtX59oGJ39n2nZpgelCb1+esFGo/LkcrKwN5imoArdfi3PWY Pij/QF1DFIOKyi/lg+mXR/TmdFyMqG1TexPCz6ynFm1EcGoPduA7Gi3R4wsF7bMEahEs EczbXyMa0rmAnLWOVBqdQAXCm0cRjAQ3Ojy5VZh7VjQU80NkMQJO28gWXYPyCXWCmon6 6JnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=hnYWylBJ53aaisbKmbIpjNjn3mAHanqwtCnV7r+/fB8=; b=OceVW+ImmOa8XILdoVp/uZiUl8lD98wsrSeOiGtIVgUuGNCmtVkHVNF7GBt7Y6kOal C/eaxamLGgamYW+MQjzVPzjfSkyLbiwp6NGgBGSEa9uwL//TJbt9vtQa/Enht1KO3BRb qVG20HN68IaWvDQj5JTZ/baJ5lzt/Lg8Orhv23Q8Qiu9wTFUf1pJave5m/Y/t+T1Yuhx Ygr9rquviU906Dd7ZjgOxI6vXV5IErM5WpEQeZ+lycF5AsoaVjou1r2syfClP8Zz9Rmv P0OhUKXgOoSgDOLl+gr9EMiYCFQgj/UXWrJ1MHxRsiKhLVOkkRSzX35bzOf7O06pJ2Pb mDiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3-v6si7088608plt.71.2018.06.22.00.43.52; Fri, 22 Jun 2018 00:44:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751394AbeFVHnB (ORCPT + 99 others); Fri, 22 Jun 2018 03:43:01 -0400 Received: from mx2.suse.de ([195.135.220.15]:48742 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbeFVHm7 (ORCPT ); Fri, 22 Jun 2018 03:42:59 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 01E28ADCC; Fri, 22 Jun 2018 07:42:57 +0000 (UTC) Date: Fri, 22 Jun 2018 09:42:57 +0200 From: Michal Hocko To: David Rientjes Cc: Andrew Morton , Tetsuo Handa , "Aneesh Kumar K.V" , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch] mm, oom: fix unnecessary killing of additional processes Message-ID: <20180622074257.GQ10465@dhcp22.suse.cz> References: <20180615065541.GA24039@dhcp22.suse.cz> <20180619083316.GB13685@dhcp22.suse.cz> <20180620130311.GM13685@dhcp22.suse.cz> <20180621074537.GC10465@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 21-06-18 13:50:53, David Rientjes wrote: > On Thu, 21 Jun 2018, Michal Hocko wrote: > > > > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > > > > index 6bcecc325e7e..ac08f5d711be 100644 > > > > --- a/arch/x86/kvm/x86.c > > > > +++ b/arch/x86/kvm/x86.c > > > > @@ -7203,8 +7203,9 @@ static void vcpu_load_eoi_exitmap(struct kvm_vcpu *vcpu) > > > > kvm_x86_ops->load_eoi_exitmap(vcpu, eoi_exit_bitmap); > > > > } > > > > > > > > -void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm, > > > > - unsigned long start, unsigned long end) > > > > +int kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm, > > > > + unsigned long start, unsigned long end, > > > > + bool blockable) > > > > { > > > > unsigned long apic_address; > > > > > > > > @@ -7215,6 +7216,8 @@ void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm, > > > > apic_address = gfn_to_hva(kvm, APIC_DEFAULT_PHYS_BASE >> PAGE_SHIFT); > > > > if (start <= apic_address && apic_address < end) > > > > kvm_make_all_cpus_request(kvm, KVM_REQ_APIC_PAGE_RELOAD); > > > > + > > > > + return 0; > > > > } > > > > > > > > void kvm_vcpu_reload_apic_access_page(struct kvm_vcpu *vcpu) > > > > > > Auditing the first change in the patch, this is incorrect because > > > kvm_make_all_cpus_request() for KVM_REQ_APIC_PAGE_RELOAD can block in > > > kvm_kick_many_cpus() and that is after kvm_make_request() has been done. > > > > I would have to check the code closer. But doesn't > > kvm_make_all_cpus_request call get_cpu which is preempt_disable? I > > definitely plan to talk to respective maintainers about these changes of > > course. > > > > preempt_disable() is required because it calls kvm_kick_many_cpus() with > wait == true because KVM_REQ_APIC_PAGE_RELOAD sets KVM_REQUEST_WAIT and > thus the smp_call_function_many() is going to block until all cpus can run > ack_flush(). I will make sure to talk to the maintainer of the respective code to do the nonblock case correctly. -- Michal Hocko SUSE Labs