Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2406224ybh; Mon, 16 Mar 2020 02:32:41 -0700 (PDT) X-Google-Smtp-Source: ADFU+vspA20M+VIVgVf771H/7W0+xz9WnYbQhRGi4ne2qhxN4g79addQVOFszOhCP89xtRri5f9a X-Received: by 2002:a9d:336:: with SMTP id 51mr21608696otv.202.1584351161108; Mon, 16 Mar 2020 02:32:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584351161; cv=none; d=google.com; s=arc-20160816; b=lUOQE2d+oIHDNHcP4zkH7aG0wbyfsDg9qvBOk6mTwSs6HY6kIxKza+86ev1HUQo/zn DrDy5Wf9/JncE7Y0RLJS64H85HN48EW8Udbec8yrLludY5su1dpx8CRnhdLdDUK1Go5k MDYsHb6yRPTGcqbDRMfCjPCY96Le+z3+Le4uq6+1PXZ89u8RryWpv5tOx4mG1o2xxTxi Q1bTXiIW/uCJxerWS/EVvrevwRpA4NSAuamZs1618H/aJf+oRC60mt6ATMg4QdRxeKM3 Yx46KKBIN21xk/8Sy7XUhKS3eiyMgD/rWPkYOU/+s+xjybeaqzv7MC5asaf7OkzKHD6m KLGw== 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=Ph+Lpxd0P8ykJk38qY3p4Me0iTKehJecocwBUyoICdw=; b=w/uW7tmf8NYWW2JBgD85+5JklD21dt6Ga0EGFxR0X5F+tBpXqdqpp5UoQKtIsKig3D j/jwFItkZWCVKqCFaIfsuPaqsAeBOwKXA1I+4yMjSJt0wxj9ybZLNAZQgP9Qgq65ZVvF m6RuYwFActiIpaUdNyjvjX21bZyw6f5MhVMJRz9iZyUaFL8N5y16VV4dwOkRScO7Uaxg aZbZKbVq8v1nLHOncLfmHgYRb1d3Gc7pfXE12uE04D4OhVSq7LZKS8M4c1KalNWTYlS6 9nR30fAopDmLcU77BOyG5rxCIFytLfPSl7lSsgkOXL4YoOrPvT6g39rclusPjLB4Zbuu +K3g== 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 h27si4230110ots.293.2020.03.16.02.32.28; Mon, 16 Mar 2020 02:32:41 -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 S1730453AbgCPJb5 (ORCPT + 99 others); Mon, 16 Mar 2020 05:31:57 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:33079 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730025AbgCPJb5 (ORCPT ); Mon, 16 Mar 2020 05:31:57 -0400 Received: by mail-wm1-f66.google.com with SMTP id r7so12850974wmg.0 for ; Mon, 16 Mar 2020 02:31:54 -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=Ph+Lpxd0P8ykJk38qY3p4Me0iTKehJecocwBUyoICdw=; b=enpOwdSvWvEc2AC8JGVPJGx1IPYRVUlnRn3NS7TPXV7GSXN7eJFh8KTT7X93soOP50 j42jkJdNapt4OEcvYZceibH8YMjRw9+eD+sgiwWBpfeGy3YVXfLWu1k4UXhaNM5dkprf NFZZy210TBLNSAQ0sJtrmhKHFV94C/rVJK39cIvzyJ29NEqn8lC+PqNGz8WkIlwviAZR 5TsECY4hZfdYKVVeMBAxr+4ZluC+W9V845D5lzP+OO4gOkGb2xHR6mhkVwQLZAQbW/1A ySZa8tlkcZ5B8BGwL6I0ptgE2jqayHa+gLvySHccSF398VY7MAch9dcGfHbVM3z6xpw6 8EoQ== X-Gm-Message-State: ANhLgQ0OGSH+1hiWSXNxf0daKO4t7GnZUjZ9IGXVq6aDb9ZgrZe/alAy UftRdx0cazA2/N19PyB4kQ8= X-Received: by 2002:a05:600c:2244:: with SMTP id a4mr25638104wmm.147.1584351114379; Mon, 16 Mar 2020 02:31:54 -0700 (PDT) Received: from localhost (ip-37-188-254-25.eurotel.cz. [37.188.254.25]) by smtp.gmail.com with ESMTPSA id d7sm20150724wrc.25.2020.03.16.02.31.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 02:31:53 -0700 (PDT) Date: Mon, 16 Mar 2020 10:31:52 +0100 From: Michal Hocko To: Andrew Morton Cc: David Rientjes , Tetsuo Handa , 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: <20200316093152.GE11482@dhcp22.suse.cz> References: <993e7783-60e9-ba03-b512-c829b9e833fd@i-love.sakura.ne.jp> <202003120012.02C0CEUB043533@www262.sakura.ne.jp> <20200312153238.c8d25ea6994b54a2c4d5ae1f@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200312153238.c8d25ea6994b54a2c4d5ae1f@linux-foundation.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 12-03-20 15:32:38, Andrew Morton wrote: > On Thu, 12 Mar 2020 11:07:15 -0700 (PDT) David Rientjes wrote: > > > On Thu, 12 Mar 2020, Tetsuo Handa wrote: > > > > > > On Thu, 12 Mar 2020, Tetsuo Handa wrote: > > > > > > If you have an alternate patch to try, we can test it. But since this > > > > > > cond_resched() is needed anyway, I'm not sure it will change the result. > > > > > > > > > > schedule_timeout_killable(1) is an alternate patch to try; I don't think > > > > > that this cond_resched() is needed anyway. > > > > > > > > > > > > > You are suggesting schedule_timeout_killable(1) in shrink_node_memcgs()? > > > > > > > > > > Andrew Morton also mentioned whether cond_resched() in shrink_node_memcgs() > > > is enough. But like you mentioned, > > > > > > > It passes our testing because this is where the allocator is looping while > > the victim is trying to exit if only it could be scheduled. > > What happens if the allocator has SCHED_FIFO? The same thing as a SCHED_FIFO running in a tight loop in the userspace. As long as a high priority context depends on a resource held by a low priority task then we have a priority inversion problem and the page allocator is no real exception here. But I do not see the allocator is much different from any other code in the kernel. We do not add random sleeps here and there to push a high priority FIFO or RT tasks out of the execution context. We do cond_resched to help !PREEMPT kernels but priority related issues are really out of scope of that facility. -- Michal Hocko SUSE Labs