Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1953537imm; Thu, 21 Jun 2018 05:06:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ9FQuR802ivl4PftA06OHwp0+huLgSxPq6kjTcNbKLgtbbozzHCJVnj3mN9DZl70dONfmN X-Received: by 2002:a63:6107:: with SMTP id v7-v6mr22655774pgb.264.1529582781895; Thu, 21 Jun 2018 05:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529582781; cv=none; d=google.com; s=arc-20160816; b=wNMfRaFEpT156DD1VTBuAeB+oDC0N6GpdElS/gvDQNXeDUQlCJDeTiuwgm2K//5ua2 ikjKbZsKim4ckBxrJdyXE7D1Wgros+DpnRAElkf5CigPlVWDxizG+em7SCI4AShBzL7q LQLZdiXitwDXTo1LM33KWZhYzyb7g5vhIa63Wx8q5j9AIPUdFFpRrb3wiUzUtFp0bv9n O4XKeQCyKtb2QpNGVqGPIbIeN6CxU11xcQyUc5oXPvT8DMw7wYCgV7PuFIuhP40gNYSl ar3XrDr8jUgil87WnCsAGjyjosT0j2JPb1v6W9/L23QPZvBC6sDl287N/7fEblGMU5bv Ffqw== 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=ti2xIYq9twwcu3z5/n3jIbFM+45K3bIvwhwTFZwCqTs=; b=jrFdL8up8PwaZRobsT39BQ6o2ZyHGGEhFjk+G4KLHekyt8BR5EXuw6qb3MCF2AIMMS du3Y5unaDVU5SsAxJR2cEUjjjwLAUkQwVD9JyETbmxcL9Ot8BOPv8qf0jWWtVKhJ6LoC ayl4lSqTfK4KkXH5eGR++6f5h0peLeaMwA4O9P0/gArZ4i6Lm5nd/fjp0mpRoNj4zi+F b5chPI12kMbrbC5RJCP3aSa46mbVtdsf5YbIYU0MM9sf1BCYYDwF6jvXltzviAb9z6Q9 ENUgb+/JYspx0TqcTy+/yiuX2TGyGMZkhRJucgA55BlkLSa95+Gz0wZ6Z4QJ+y5ulYbs vzvw== 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 i5-v6si3982032pgt.346.2018.06.21.05.06.07; Thu, 21 Jun 2018 05:06:21 -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 S933347AbeFUMFQ (ORCPT + 99 others); Thu, 21 Jun 2018 08:05:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:37781 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932595AbeFUMFP (ORCPT ); Thu, 21 Jun 2018 08:05:15 -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 DBC46AD91; Thu, 21 Jun 2018 12:05:13 +0000 (UTC) Date: Thu, 21 Jun 2018 14:05:11 +0200 From: Michal Hocko To: Tetsuo Handa Cc: David Rientjes , linux-mm@kvack.org, Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm,oom: Bring OOM notifier callbacks to outside of OOM killer. Message-ID: <20180621120511.GG10465@dhcp22.suse.cz> References: <1529493638-6389-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> <20180621073142.GA10465@dhcp22.suse.cz> <2d8c3056-1bc2-9a32-d745-ab328fd587a1@i-love.sakura.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2d8c3056-1bc2-9a32-d745-ab328fd587a1@i-love.sakura.ne.jp> 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 20:27:41, Tetsuo Handa wrote: [....] > On 2018/06/21 16:31, Michal Hocko wrote: > > On Wed 20-06-18 15:36:45, David Rientjes wrote: > > [...] > >> That makes me think that "oom_notify_list" isn't very intuitive: it can > >> free memory as a last step prior to oom kill. OOM notify, to me, sounds > >> like its only notifying some callbacks about the condition. Maybe > >> oom_reclaim_list and then rename this to oom_reclaim_pages()? > > > > Yes agreed and that is the reason I keep saying we want to get rid of > > this yet-another-reclaim mechanism. We already have shrinkers which are > > the main source of non-lru pages reclaim. Why do we even need > > oom_reclaim_pages? What is fundamentally different here? Sure those > > pages should be reclaimed as the last resort but we already do have > > priority for slab shrinking so we know that the system is struggling > > when reaching the lowest priority. Isn't that enough to express the need > > for current oom notifier implementations? > > > > Even if we update OOM notifier users to use shrinker hooks, they will need a > subtle balance which is currently achieved by mutex_trylock(&oom_lock). No they do not. They do not want to rely on an unrelated locks to work properly. That is completely wrong design. We do want locks to protect specific data rather than code. > Removing OOM notifier is not doable right now. I haven't heard any technical argument why. > It is not suitable as a regression > fix for commit 27ae357fa82be5ab ("mm, oom: fix concurrent munlock and oom reaper > unmap, v3"). What is the regression? > What we could afford for this regression is > https://patchwork.kernel.org/patch/9842889/ which is exactly what you suggested > in a thread at https://www.spinics.net/lists/linux-mm/msg117896.html . -- Michal Hocko SUSE Labs