Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp505029pxf; Thu, 11 Mar 2021 08:24:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwp2USKy8Fjw3YDLiHlPdKj5vWGT0EIcpEtzYavqQeyQTHohobqnHyYhck37sZSjGg0Yo0i X-Received: by 2002:a17:907:b06:: with SMTP id h6mr3827827ejl.144.1615479884547; Thu, 11 Mar 2021 08:24:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615479884; cv=none; d=google.com; s=arc-20160816; b=wg8FdpczXIfeYtbQWRm0PTB+wUgO0H1xQ4KzMLVxG4QUx5GgIMX2YsVJMcBS6edC8X LYOyg8/5870xxdJfwfkKGqgTgbXrFiNFEIrW+hBKYDWGuNVfyGLlgbQa+1S7omzFW+Ia reeqEvT4FXrLkQOvzjDwIS/iPZFoTrc0AB+f19WYjVDrjWrDoAMCjQeiQ5ff4mNeTmKV 7qqdH2Vf8I3+US0Vp5UUxM1TtpR3D8273tn7jtStPWcaSBNuYvCmFZBrJOTfHb9Onink FDG/9YyEIc0aKg6X5YHoSSAWSyHEMgQjnu5VHIWO008UjbfrLMwQw5FsbSvIJFE4ILUj ZaEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JCazLcUvicbjHvArKpub7shZHTSmNlrKDPwSJp39RjQ=; b=gWRnk4iK1kbek+jAuzB1iB65/QDl+ppoJJ/2q0F4G57pLhZ8KBWtWYMp/cXvkYkZl9 obpHdEZiSmdg6GJQODas/5ruMuIYRmm0LF5Ii0HnzUs4m37aF1lPDjZnjnu/cp2E6Q0U NdtLfrcp9TvvyzbG9UinBFcMQ5uo+Vf8DA+S2cGf+3J6uOhtBfpnibvUQTzjG4cULFMi Cn/6Hf5vWRdBw8smZqIm8gfrM3vGjwLYnJBxDmYboj9VSwbvO90Z3OrvR3gN/n8VRMQT BlscWmDZDCdJFrybEfDrgAgzBA0UHQDbVzanpgj4dnWHVfMRasroWBGHEBoeV33HSFs8 kAbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=Ot+Zpzno; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ci11si1333117ejc.440.2021.03.11.08.24.21; Thu, 11 Mar 2021 08:24:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=Ot+Zpzno; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234236AbhCKQVB (ORCPT + 99 others); Thu, 11 Mar 2021 11:21:01 -0500 Received: from mx2.suse.de ([195.135.220.15]:51026 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234382AbhCKQUc (ORCPT ); Thu, 11 Mar 2021 11:20:32 -0500 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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