Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1709105imm; Thu, 21 Jun 2018 00:55:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKzfcTO32Cn2vIfiVZ22U1I2KyKdVbjKUEvtnUwvrqkMhrRJrfcqq7OrcTOZzcSFmBXJTkt X-Received: by 2002:a17:902:b786:: with SMTP id e6-v6mr27045388pls.260.1529567754671; Thu, 21 Jun 2018 00:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529567754; cv=none; d=google.com; s=arc-20160816; b=NlqT/n6CGUigQLdrWIhGR3G8TLZus3rakY8Qs8V1n12McGPzS+WJzjSB2zFlfbY+Fe l6/b1uwph37m4Czc4+Y/O8SIrpOnwWnComCqfcwQDf6f0DkAgFG6az7QGs+38QAXyVTU XdNnSZfAFpDU+KGsV9mkaJg9RkkUhcZn4mLhq/QoVa64/frCk4wALWEp5Xrqw0ZZ+hp6 yYZ+HzMYxLat5zLw0E42Y12DBGXTLlrrY0gKu2MlburIpqh5fWCIzfT1BOk7rSdRY7iB EI4IG3HmzlvS6zvITw1SCH7UVAmDOtp+egBe136NnMkJuVsIAGMxLL647btjztpzPLkq H5nw== 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=JIgUlIHgjOzyKBzcJ9RjRDBhGi3tRLoJ84b+kDfVpJQ=; b=gNKONts5i53v0/YW4bacEji/s3kitIgSdktnbmyyxK+Sv372YtUnfjeIGx+obVC2Jt oXQskU/WizpI2yz+a0TWV5R1iSJYvCAM2Jo02i3Uz4kV9VenHBBtn3azkZOZmFSBW47v 0r9ywhJlty+Z5SjlBImLXFhF7M3fX9D5TaTzLYkJgtqVZLAiIBlBdO774AJjtPIpYmrD QbOMExJSib7Wdkv5suErDHvVTV0dbqZQIlJbUmmJbwjQl18WhU7s8UY8I0odGLHCEZpr 5JDMPA+3phEOHTe8Tr4dWbbf79RyJmltVL5ozEDD+nzO0ttTUZ9XPPY3AMtLB6wn9Ls0 NOXw== 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 l61-v6si4114264plb.507.2018.06.21.00.55.37; Thu, 21 Jun 2018 00:55:54 -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 S1754226AbeFUHyy (ORCPT + 99 others); Thu, 21 Jun 2018 03:54:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:35636 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754093AbeFUHyx (ORCPT ); Thu, 21 Jun 2018 03:54:53 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 79D6BABB8; Thu, 21 Jun 2018 07:54:52 +0000 (UTC) Date: Thu, 21 Jun 2018 09:54:51 +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: <20180621075451.GD10465@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: <20180621074537.GC10465@dhcp22.suse.cz> 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 09:45:37, Michal Hocko wrote: > On Wed 20-06-18 13:34:52, David Rientjes wrote: > > On Wed, 20 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? Sorry I meant kvm_make_vcpus_request_mask. kvm_make_all_cpus_request only does a GFP_ATOMIC allocation on top. -- Michal Hocko SUSE Labs