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=-9.9 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL 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 48C58C1975A for ; Thu, 12 Mar 2020 18:20:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 119B0206EB for ; Thu, 12 Mar 2020 18:20:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="PbsJWk4c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 119B0206EB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A16A46B000A; Thu, 12 Mar 2020 14:20:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 99FE66B000C; Thu, 12 Mar 2020 14:20:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 868296B000D; Thu, 12 Mar 2020 14:20:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0140.hostedemail.com [216.40.44.140]) by kanga.kvack.org (Postfix) with ESMTP id 6AF486B000A for ; Thu, 12 Mar 2020 14:20:36 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2EEEE5848 for ; Thu, 12 Mar 2020 18:20:36 +0000 (UTC) X-FDA: 76587525672.18.drink79_2253634e1ce08 X-HE-Tag: drink79_2253634e1ce08 X-Filterd-Recvd-Size: 4793 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Thu, 12 Mar 2020 18:20:35 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id 39so2868519pjo.1 for ; Thu, 12 Mar 2020 11:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=sitKDgz0+LgOUGSpSSKOiwIOdws21DnB8cqKgpJ9nJM=; b=PbsJWk4cyqT0fCsrZEU4WqJL4RHHSQpca/DV1+0vlTsK4AeMwDGs4i3AdILikQOpB7 0OKTw82se3eH+rxgIAdo4VLn3zynA4SxqPgmhAkWM3p+BJrcvGQxNzZ6OuJw0SXEmWAz aCVGrFuKkm2qtNNPs7PVXUSpWNXF/qhfQmOZ3L4vJ5lyNq7dSbO6PX1JA6Q4XZxuGUuf qkVI0aTv8TfqHZ5nQey6dupAMuDBbXytb7GeCoKv4BcQ445jFrpcndcitndxjkYIE0jQ 63B3Y6M/dUWY3HlN7SBazVSznnaqH/ZrIYb9oca6+/ZDfIM042kSZ9GaEgd/kHM04o9Q 5Rcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=sitKDgz0+LgOUGSpSSKOiwIOdws21DnB8cqKgpJ9nJM=; b=YPzZ3ZUO3RxFIdWl4Ms1OTWH65/2eym8JC7vCm9tramVFFw4eDeV3oxOwDGROnOXwP LQc1cmSAG66LfYge7GtaMFh1urDxuxXgu+qCyQB7LQNB6Xy9/Dy9MmLzB9vH5tPDscn9 Ez3v95SmuldVEWfyg7Wv06vUn6ceGXMhnRX3IDnHNJPM/ZGOTF96L2ZwVFu1Z73UTdYO eA3UbPto49979rZuN/kEz+q7JM6uPpMd335W34DzN7DuPVLCwzj95JOtoIXgwfLMTgYw Bi4Ds9M74m6r7R65pgETvdo3SJ0zwq1d3VU4SKBynIzZthLnJOPhf3jy58agXLn06Jpb Itgg== X-Gm-Message-State: ANhLgQ1ZLwo+4+nFUMBX5GrIEgAvWRaH1tBU1oPGW1BrFA5V7y/crJMk 0qqV/zc1iTNo0lrdE5Ar3WG92Q== X-Google-Smtp-Source: ADFU+vtDzVDzQennu+P0iZ4plMN3zZILYTl7HKoNff1VX+/NCUykYYtYOBjMkO1u7Mr2wMvpjotZXw== X-Received: by 2002:a17:90b:310c:: with SMTP id gc12mr4901073pjb.193.1584037234557; Thu, 12 Mar 2020 11:20:34 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id e7sm1869108pfj.97.2020.03.12.11.20.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 11:20:33 -0700 (PDT) Date: Thu, 12 Mar 2020 11:20:33 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Michal Hocko cc: Andrew Morton , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch] mm, oom: prevent soft lockup on memcg oom for UP systems In-Reply-To: <20200312083241.GT23944@dhcp22.suse.cz> Message-ID: References: <20200310221019.GE8447@dhcp22.suse.cz> <20200311082736.GA23944@dhcp22.suse.cz> <20200312083241.GT23944@dhcp22.suse.cz> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 Thu, 12 Mar 2020, Michal Hocko wrote: > > I think the changelog clearly states that we need to guarantee that a > > reclaimer will yield the processor back to allow a victim to exit. This > > is where we make the guarantee. If it helps for the specific reason it > > triggered in my testing, we could add: > > > > "For example, mem_cgroup_protected() can prohibit reclaim and thus any > > yielding in page reclaim would not address the issue." > > I would suggest something like the following: > " > The reclaim path (including the OOM) relies on explicit scheduling > points to hand over execution to tasks which could help with the reclaim > process. Are there other examples where yielding in the reclaim path would "help with the reclaim process" other than oom victims? This sentence seems vague. > Currently it is mostly shrink_page_list which yields CPU for > each reclaimed page. This might be insuficient though in some > configurations. E.g. when a memcg OOM path is triggered in a hierarchy > which doesn't have any reclaimable memory because of memory reclaim > protection (MEMCG_PROT_MIN) then there is possible to trigger a soft > lockup during an out of memory situation on non preemptible kernels > > > Fix this by adding a cond_resched up in the reclaim path and make sure > there is a yield point regardless of reclaimability of the target > hierarchy. > " >