Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp801117ybh; Thu, 12 Mar 2020 11:22:21 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvMBKMcoGSHSMFrxgaQfZMQ6lJCArKk6NKyKunYEynKLkkMse4L0Xz7M9yh42cPvKFv5Q8w X-Received: by 2002:aca:1e07:: with SMTP id m7mr3508106oic.41.1584037341104; Thu, 12 Mar 2020 11:22:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584037341; cv=none; d=google.com; s=arc-20160816; b=ZikRdD45oWXBssYVglrNFSsC7UPDWV6QYMRAj5dt8JYB/aSuSNlZtnKHL0KchrVYtO TDYz81CNYv1UfWnofAQzAtPIRSAkAAjglFclAGnVhIhtOJxbJMKrOo0C4QJ96WsRjfj5 17v/wMR3plmfPz6B/lc4in9Ojr6Lu805Xf0GNan3IEOxQBFwT3eHhNFw8YXYJMrQQrlY rFV2FvExK7Ct366BZhY5lOxsgUaTiHV6JYPkEJnhz/eXTrh4lt50hUcPYvCozV4utMyE B+IW10LxCwvA7cRRfaO6LXMyT2f/SjTeM7WCW5v9sVtY+dUL71cdIjnMUhMZxVDdGElu v3Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=sitKDgz0+LgOUGSpSSKOiwIOdws21DnB8cqKgpJ9nJM=; b=JLNS5GPTpgOQ6P5g439uahdZouVHChKzdewovwSixr+38anflozk0Pl/XIBAXASwTj knYLh7G51nnCTyWuXAiAWe56cqpQ/I1SbXU9vQ87nIvewXlYRcvEbpF/BhfWxvmoo/F5 mhztKTYzR693UxEY++5hMHVKx47D7bIRmxIemqF3oRl9FwBaEWihnYiyZPzVeOITb3TU 52IjKx0uG6gxXZoXst8CBNjPCvc4Eu+eqUUFfhjcvai5Z/vv5vhl1lTGQUcortU6OmFF hYULd9kBYzuxgrP8AWJ7Z0pS9Ns+P8apWgeq1hYMvhpqRPs/eUPvIqCfMvoY6KTX9o+2 9jcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=PbsJWk4c; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v13si2984942otq.129.2020.03.12.11.22.07; Thu, 12 Mar 2020 11:22: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; dkim=pass header.i=@google.com header.s=20161025 header.b=PbsJWk4c; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726571AbgCLSUg (ORCPT + 99 others); Thu, 12 Mar 2020 14:20:36 -0400 Received: from mail-pl1-f176.google.com ([209.85.214.176]:44316 "EHLO mail-pl1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726328AbgCLSUg (ORCPT ); Thu, 12 Mar 2020 14:20:36 -0400 Received: by mail-pl1-f176.google.com with SMTP id d9so2968022plo.11 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=MYM4+NmlPShd0PnAvy5huUfneSBbYdlJOM4Fw6PiTZXZBM+nNYN+UZBe3WQVVYwPXf eWDCh9dMFq+rUVhrg5+hvrD6dlHJqhkGMS3mg//4SEG5JcX6ozxXJ4J0TE+mZEFsa+7A Y1NU6x1HWBN3RFqkefj1y9AiXCddX2cBVuesf3pKwWWcttY1OdsiOZRLbzqcl+CdZX+p MXprSnXCzfCgzASLZTK1ij2tlCCaQEjPoS2nfiY4JcluWyWrY0K4mAqp9N47xd1hHsE3 hGgFj7Cg9p54dLbEk3dXqeyh6aKFHiNdK5c4Yo1BMfHfcSxWE+6Yv8OHEu1Bs1M+t554 4SNw== X-Gm-Message-State: ANhLgQ3mpGSesvHK79MR4r3RgXlc4d6BBj2uCkXKANer58iZFW+uSA+B LgJLm3pSvcEFSlqiXXngSqZC/ugtQwY= 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > " >