From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21AF9C433DB for ; Thu, 11 Mar 2021 16:20:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A507664FE2 for ; Thu, 11 Mar 2021 16:20:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A507664FE2 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E96808D02C9; Thu, 11 Mar 2021 11:20:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E6DA78D02B2; Thu, 11 Mar 2021 11:20:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D347D8D02C9; Thu, 11 Mar 2021 11:20:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id BBC638D02B2 for ; Thu, 11 Mar 2021 11:20:45 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7B4E98249980 for ; Thu, 11 Mar 2021 16:20:45 +0000 (UTC) X-FDA: 77908106850.15.584DD13 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf18.hostedemail.com (Postfix) with ESMTP id EEF7220003A2 for ; Thu, 11 Mar 2021 16:20:38 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1615479631; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JCazLcUvicbjHvArKpub7shZHTSmNlrKDPwSJp39RjQ=; b=Ot+ZpznoDen4a6aIAaDKNvpnzNFuDCDrWlV6RxRWng0vBUfuagjC2NN8PIUPzyWhY4bYCJ qEdX5hhKL94mGWtpYY2cIXfdaqMz0pcbUJi/ftU5nOM/E9ijf8CJZetQ9JtN25oi2yg2T4 ki3UmPhLnI1fvsmeZ9Pjp5HNpCe/esM= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 43B9EAC16; Thu, 11 Mar 2021 16:20:31 +0000 (UTC) Date: Thu, 11 Mar 2021 17:20:25 +0100 From: Michal Hocko To: Jason Gunthorpe Cc: Sean Christopherson , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, David Rientjes , Ben Gardon , =?iso-8859-1?B?Suly9G1l?= Glisse , Andrea Arcangeli , Johannes Weiner , Dimitri Sivanich Subject: Re: [PATCH] mm/oom_kill: Ensure MMU notifier range_end() is paired with range_start() Message-ID: References: <20210310213117.1444147-1-seanjc@google.com> <20210311002807.GQ444867@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210311002807.GQ444867@ziepe.ca> X-Stat-Signature: ny961a4tb75oyfpqrbdyuwtm9f14txyo X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: EEF7220003A2 Received-SPF: none (suse.com>: No applicable sender policy available) receiver=imf18; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615479638-95041 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed 10-03-21 20:28:07, Jason Gunthorpe wrote: > On Wed, Mar 10, 2021 at 01:31:17PM -0800, Sean Christopherson wrote: > > Invoke the MMU notifier's .invalidate_range_end() callbacks even if one > > of the .invalidate_range_start() callbacks failed. If there are multiple > > notifiers, the notifier that did not fail may have performed actions in > > its ...start() that it expects to unwind via ...end(). Per the > > mmu_notifier_ops documentation, ...start() and ...end() must be paired. > > No this is not OK, if invalidate_start returns EBUSY invalidate_end > should *not* be called. Yes, this is what I remember when introducing nonblock interface. So I agree with Jason this patch is not correct. The interface is subtle but I remember we couldn't come up with something more robust and still memory with notifiers to be reapable. -- Michal Hocko SUSE Labs