Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp996165ybh; Wed, 11 Mar 2020 15:15:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsj+/Pd+JCLK95SA1H+lj4mzNrcpagr7NZb4lYxIJB1WkxvAmpNxHQgVnTXb/rwLq6d8mpt X-Received: by 2002:aca:80e:: with SMTP id 14mr548651oii.143.1583964934318; Wed, 11 Mar 2020 15:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583964934; cv=none; d=google.com; s=arc-20160816; b=EeT3Kc7xE1rUu2fVGqPJDW6jKUvm8geAM9jQI8O4r5vtMIp5YEfyeza9okNjXAmbKE aTBNUFzcxFX1kSrN/r8PtBUrMtIqj8UPv34RvUBPpExYpUYWFA+NEEM/1LdT+MkQFTUU yZQoyMvGq8Hzx293qFnUbOCS5xp88P+JKFT3kNgm7KqL5CMXuIfdFSa0aeExzMuehNrX Tixf8Zw5UHeeZLQOfazelv+Igz3fNNalYQ+hpePgvTZYt6z+1dECd0gVtqGiCElChtS7 hZ7fwEMA+XVnbFaC8zqLTOZKXTphIyPzPaQHRryIrQF4cQDRUbbXe+kWVX8jaonjNUiT spGA== 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=kqs/8sz45lI1W+UaTgUeqYCXywblUMLwa/zPPOrBl34=; b=1BGq/RJNtOZt7EhgTjVOLnVwSKIzNJWm69CbQSIDerfzivLuDoPcXAGEugfDeIKSYw Yr67ua/5ofLJFTPba4LfsORmbLD2gk+JnD01CHsmRjlr1Jw1/X3KMPyDPPjhRBgnt/ST e6v9uh6755TNn81K0ct4Vfh/nsCXmqImQbF8V1MsJf8YaXDjctwy4f9FjInLZB9mL7DW QnyfS8ElMe4T5hDq5+9rqRaKMHtc6961JcV9L+TKoxH8uwmBjOgzhLgoesW0laOWAu7H 9SXg4feli6z40jT2UbcGcCAlqQCVVokIWQ8BIGVSrD43Bkny/ZIF+W5ek5Jfzy/IQmtm 1jRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=KPGi6V35; 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 i15si1811850ots.121.2020.03.11.15.15.22; Wed, 11 Mar 2020 15:15:34 -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=KPGi6V35; 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 S1730049AbgCKWOm (ORCPT + 99 others); Wed, 11 Mar 2020 18:14:42 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:39391 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729680AbgCKWOm (ORCPT ); Wed, 11 Mar 2020 18:14:42 -0400 Received: by mail-pf1-f193.google.com with SMTP id w65so2134397pfb.6 for ; Wed, 11 Mar 2020 15:14:41 -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=kqs/8sz45lI1W+UaTgUeqYCXywblUMLwa/zPPOrBl34=; b=KPGi6V35T5HQHjCWG4Z7gR6q4bB8iESFyiWU6TFFkgFgzWsIuD7BumZRY8axcU9poH omhvgpVVX2TYOhkLTBAD0E+H8HQum0MaXIZl5p8UWGxp5LB7C2ZhRxUZGxeUjYkyGNb2 IsNDwI2P03H/O84UiUKrsJbA7ZTKk8GDIhIhTG3G5p9yJv53AFZWT2Tjrg8ohpq88F2B DcdCJN6hUl3JV6bw/CidifP9bQ9fEdkNJuANrAQSY5bDPvqmM+YTfXU29Ja5VjvRKQYD a/QrEG7uKG9NEfOBNZcOYfymFr5x0J+zTjIGl0DvtXi0OXDLAdqyRJt6Jb8XMWFt62mZ 9shw== 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=kqs/8sz45lI1W+UaTgUeqYCXywblUMLwa/zPPOrBl34=; b=WtKMs5cpQQYc7+NaOar50d9SF456JTJ4TddcRfJc/AmADToTzaqmFPrQk83WimXCTg +yxm8sK8LcO+ZVtjVAA4K7Q2k04+QCZC248pJMleEZcF4lZa/0C3hO+1swtEC4A63eki dvUyBx4rHWVjzhDisNq5lT8D/hs57o+ihI908ForQjxKUfkdFqLH5VTshzQ/b7aUSNub RabMuRUmHyApegWdQYrOF2IFxId3rsRaj3aXYkA/NkxINKVsHfO2GpPl40jl2K6SmlrO 8Pl07WZLronLGgC3DCHnxTkn4S3fUFzAE8ZSjiVLf46wHeJnZNFeA0B1PVnpsieDRXkl zw3Q== X-Gm-Message-State: ANhLgQ1RO+rpua06Sh+vKHj6nYadKZCr47m+x12COGSU7yjk3lYZtcl1 C/FzGHSjK9mueUKy8+f2sXyJPQ== X-Received: by 2002:a63:5d8:: with SMTP id 207mr4716417pgf.413.1583964881100; Wed, 11 Mar 2020 15:14:41 -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 a143sm29357820pfd.108.2020.03.11.15.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2020 15:14:40 -0700 (PDT) Date: Wed, 11 Mar 2020 15:14:39 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Tetsuo Handa cc: Andrew Morton , Vlastimil Babka , Michal Hocko , 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: <993e7783-60e9-ba03-b512-c829b9e833fd@i-love.sakura.ne.jp> Message-ID: References: <0e5ca6ee-d460-db8e-aba2-79aa7a66fad1@I-love.SAKURA.ne.jp> <7a6170fc-b247-e327-321a-b99fb53f552d@i-love.sakura.ne.jp> <993e7783-60e9-ba03-b512-c829b9e833fd@i-love.sakura.ne.jp> 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, Tetsuo Handa wrote: > > The cond_resched() here is needed if the iteration is lengthy depending on > > the number of descendant memcgs already. > > No. cond_resched() here will become no-op if CONFIG_PREEMPTION=y and current > thread has realtime priority. > It's helpful without CONFIG_PREEMPTION for excessively long memcg iterations to avoid starving need_resched. > > schedule_timeout_killable(1) does not make any guarantees that current > > will be scheduled after the victim or oom_reaper on UP systems. > > The point of schedule_timeout_*(1) is to guarantee that current thread > will yield CPU to other threads even if CONFIG_PREEMPTION=y and current > thread has realtime priority case. There is no guarantee that current > thread will be rescheduled immediately after a sleep is irrelevant. > > > > > 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()?