Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2407213ybh; Mon, 16 Mar 2020 02:33:45 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuMJrgKFTkiUvrH5HYkzcv3Ycj7+3jH0/yMgu8iip2x6/nnz9LyqN/CqILkaxQEZ8pEIR74 X-Received: by 2002:aca:f183:: with SMTP id p125mr9985274oih.74.1584351225660; Mon, 16 Mar 2020 02:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584351225; cv=none; d=google.com; s=arc-20160816; b=BjYVKkeU6jSFSaxU1xLnGdJahzYRxNVen+8WM4ZVo2KE12YrqIbKUWUVNC123B5DcH wLg6tAljxYhhc6mcS1XX5ENxFpNPLwM2oPz41rIovOG/MfQFYXRJ8RNWrMRznEQ/2bB6 84jjl4mdtGphiXYngsppyF3vLWuACaKx4eU9Q3rPLyMD2VOz4FVLKvQkB+3I3PNV5eji kdSYpSDo5Vj7W+BaCMtEzgvO5+Rp/QV6AHBi/AYNMlBhywSQpuVwY1ssDHhrlAnOfIIy 5EaswAbnqKb9W/mlRcJ7fjQMD1OzDJ9yxGxlZ/GBDj8pQd64t0woV2cAoZ/Gwd1CHGtS zU8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=oEYSbzcwvWV4DLx8To++eoIp8BYJ//m6HHg73CdsKHw=; b=fejB8bWSl7qo6vpWPNriexGd52GRBA2drMJQUqEvUEnKwE1QzMX4B+lC90r4n6+u8K 95fv/4PishfiF+qKzhqoglhUvliOfT+AyX1yuJIT2ylOp5LNzgsVmLd3rKHQMBpEFnAz GUopKoiuoCrs+IiN2vAF/I3WhCqg41zCjPePrjuCcrJWEL8m9+6bgsyUY4v2gl3zEgN4 VGvzMebXAEryAovx52riKMiGTMcN1Wj7I6ir361q6xWx2odtOTtUfvcbrLH0G966IB1d Rvg7gYXgFQIT9UG6F7mue9pCynwEOBQ18TLcRB6GC4pW2oi5bngOHGKR1OOcHB9FvPPj Rz2Q== 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 v25si9476166oth.274.2020.03.16.02.33.33; Mon, 16 Mar 2020 02:33:45 -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 S1730483AbgCPJcl (ORCPT + 99 others); Mon, 16 Mar 2020 05:32:41 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42176 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730025AbgCPJck (ORCPT ); Mon, 16 Mar 2020 05:32:40 -0400 Received: by mail-wr1-f68.google.com with SMTP id v11so20247799wrm.9 for ; Mon, 16 Mar 2020 02:32:39 -0700 (PDT) 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:message-id:references :mime-version:content-disposition:in-reply-to; bh=oEYSbzcwvWV4DLx8To++eoIp8BYJ//m6HHg73CdsKHw=; b=g55uLz9/Zy16wZpzq2f8Q/G+Gns7WsSIhCd4XkVUs7azIxVFa9iJ0rXT5sZF+hVz7r 5NkC//AlvMna1LFBnJeyoQSzYbgjUO1IPRFD+n++EUsjHvSy0icdYHaXwwnkN7pWU51T E2zTU2wzo/Zmn+PrkThwnv/D0ssNZ1lo73Z/hc6HIpZVX7ztTHbPn8IUw5mqZOLGD3p4 tjG1t6v9WRraRldANI3PoP5wOj0IcY8kADLmEhD2ERt1t4Re4SsNP0ViJLP851PS7KlI s7gnquLbqBdOZUm89TMzkYiQDEmeY+EqsvMe6YWYW3JTGuICNpWhR3aXieH8ewtVLmu8 pRkg== X-Gm-Message-State: ANhLgQ1TMNcPCo4jmt40m7k4pXVGUEP7hP1bdWkgZrCpC4TZ7tSKGzYV U0auNs+slzOUnpLEuCIDjyLpxI9C X-Received: by 2002:adf:f688:: with SMTP id v8mr6409318wrp.344.1584351158748; Mon, 16 Mar 2020 02:32:38 -0700 (PDT) Received: from localhost (ip-37-188-254-25.eurotel.cz. [37.188.254.25]) by smtp.gmail.com with ESMTPSA id p8sm24718070wrw.19.2020.03.16.02.32.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 02:32:38 -0700 (PDT) Date: Mon, 16 Mar 2020 10:32:36 +0100 From: Michal Hocko To: David Rientjes 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 Message-ID: <20200316093236.GF11482@dhcp22.suse.cz> References: <20200310221019.GE8447@dhcp22.suse.cz> <20200311082736.GA23944@dhcp22.suse.cz> <20200312083241.GT23944@dhcp22.suse.cz> <20200312201624.GD23944@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200312201624.GD23944@dhcp22.suse.cz> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 12-03-20 21:16:27, Michal Hocko wrote: > On Thu 12-03-20 11:20:33, David Rientjes wrote: > > 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. > > In the context of UP and !PREEMPT this also includes IO flushers, > filesystems rely on workers and there are things I am very likely not > aware of. If you think this is vaague then feel free to reformulate. > All I really do care about is what the next paragraph is explaining. Btw. do you plan to send a patch with an updated changelog? > > > 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. > > > " > > > > > -- > Michal Hocko > SUSE Labs -- Michal Hocko SUSE Labs