Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3871840imm; Mon, 25 Jun 2018 06:06:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKw8dcknBy7IQIQ+xnbnjlBLV7KeIoxL1OsTz6DMT3nlddzTgxzoXSVduFcWy+PN0viyqXv X-Received: by 2002:a63:7a43:: with SMTP id j3-v6mr10522084pgn.363.1529931967225; Mon, 25 Jun 2018 06:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529931967; cv=none; d=google.com; s=arc-20160816; b=hJr+toaXnrDbf6UvzgZjumKgTs4RxkZNQLbo3u9KOXbMXzorsbK6F0dY0Md37Ksn1o EiQSb4W1ukRBoczf932AbdBaNjjNz1FNDH7uQLxo/Dp37Xw4j2ZHvPAIcs6+QwovbhIA hzufbaAqVAFjiHVMLRM5m+Y/uqNETESpgEI8kRNy1qv6aeJ/7iprxq7ZCDOox2/HzVFM N3R2csuo5CZanBfW10IZXEOKPXf9+KYqQSmqwSENcBIUD2fFvd3sEeCOlcwlFNKu4Umj +7E8wwHeEosO89cozrSH3VKl0N+2euZlT7jQfREjw3oC1kXFgJz6PBhpHprKiazJfnY6 TX6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=plDLAuhtaFseyXHvibWHGYAoJWUTWDERBopbykpdLSA=; b=O27pdyYaU+gBfQ3wSqqPvSrsvBULJo9ZHbILTxVuUXK95VvupnoAqv0UE6QrG+jQnY +cQW5AJ2NJnLC45szu9Za0dl3Ej/t9CKZmYfoxixATw9KkBcnaaAXPHFPlYec26i4BLb FE/T1NzI3kNyMAFc/t083v387Z5qtMoiXwQLzhiFqdF5g3dHQF5CKuYi6jDztdWQRlQR kgOG4HFZrmu3wPHADlT/oQGuDeCoW3MUFPiGsXtDyV91NoQsl6jbif8r1fiofy47z9nR QmuaaXZwuK9Z/waWtnY97UP+LDd4+lG14QB+xfexkaN/flvpB2AZ5UkiAihQHmw5EjDW GZAQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m37-v6si13676068plg.491.2018.06.25.06.05.50; Mon, 25 Jun 2018 06:06:07 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755485AbeFYNDn convert rfc822-to-8bit (ORCPT + 99 others); Mon, 25 Jun 2018 09:03:43 -0400 Received: from seldsegrel01.sonyericsson.com ([37.139.156.29]:14415 "EHLO SELDSEGREL01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755221AbeFYNDm (ORCPT ); Mon, 25 Jun 2018 09:03:42 -0400 Subject: Re: [PATCH] mm,oom: Bring OOM notifier callbacks to outside of OOM killer. To: Michal Hocko , Tetsuo Handa CC: , , , References: <1529493638-6389-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> <20180620115531.GL13685@dhcp22.suse.cz> From: peter enderborg Message-ID: <3d27f26e-68ba-d3c0-9518-cebeb2689aec@sony.com> Date: Mon, 25 Jun 2018 15:03:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180620115531.GL13685@dhcp22.suse.cz> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/20/2018 01:55 PM, Michal Hocko wrote: > On Wed 20-06-18 20:20:38, Tetsuo Handa wrote: >> Sleeping with oom_lock held can cause AB-BA lockup bug because >> __alloc_pages_may_oom() does not wait for oom_lock. Since >> blocking_notifier_call_chain() in out_of_memory() might sleep, sleeping >> with oom_lock held is currently an unavoidable problem. > Could you be more specific about the potential deadlock? Sleeping while > holding oom lock is certainly not nice but I do not see how that would > result in a deadlock assuming that the sleeping context doesn't sleep on > the memory allocation obviously. It is a mutex you are supposed to be able to sleep.  It's even exported. >> As a preparation for not to sleep with oom_lock held, this patch brings >> OOM notifier callbacks to outside of OOM killer, with two small behavior >> changes explained below. > Can we just eliminate this ugliness and remove it altogether? We do not > have that many notifiers. Is there anything fundamental that would > prevent us from moving them to shrinkers instead? @Hocko Do you remember the lowmemorykiller from android? Some things might not be the right thing for shrinkers.