Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1148927ybh; Tue, 10 Mar 2020 15:56:25 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsihkdURP4b+mGnAEXseqSlc7V7oK9E7v0wD3yKJAoJY5KCKL1tbGvxCogxTfPVl4/1oHzP X-Received: by 2002:a9d:5d09:: with SMTP id b9mr35310oti.207.1583880985157; Tue, 10 Mar 2020 15:56:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583880985; cv=none; d=google.com; s=arc-20160816; b=iS58n+UVJpylN1QfD55uHwLXPDsrgNZnH2JlTzItEoMdb6neh0Z8DC2l2lnRXbifNY yru0wplk2Wr36vYP+w1W0abUS50PlpSAEURxFJpUD/Zg/8MpH5S6HRv+yjVrX4B5CpuR 7VkfUUoURcuGA0s71IHXwVx7vYQUmz9mn0AqkbNb1pU6qIsfpJ8AoqjlEfTPm6Ge4bFR bmOtEboEoGIB5RK2+q0FQP304nGKTD67+fisUGi8C/jcZ7RN5KV1QAJy5fWAf5kWmIMJ pUBh86BepYRe0++Ro1m5xp1kRiBa9V+DFETrmKE7StgKYW8OqBXEF4DtB23qWDv1iZ02 0mYg== 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=9qaiYIGTi5RptJqzXrWrO9DTMLRu6kbwYuAs5GV2464=; b=C/CEiemxSP0bhZja9kDEktupZLel+D4v/EQ2wBU2nDeh178peKgOkkKborp1OXx+nw gqGeAyf7YXpIlhDeL+tRpUaC/BjWR3nB/9GXPZurBRh/A94ev7GrrZzcfVsSz/u+CAkf ZO0wON0Pm9YQ9aoHZWPBzc0VLIX+wZYRoWIXj7ycvAT+7DvuFpTPsZiQW4YHxRtw9ktp 5VhDqUeigZl/7oQ/9bf+0+j4ukotLr8oYjlDn/lWdugHgDU5eOCvivTkyFzTRXFb+Jh5 lg4BUmisc0nsfqpv0TQhR0VAISo5qbKu7MNzNnAf0lcENwJJobugN/0qlTqLnFT5ycOz rsaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YKOsszmC; 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 x10si29447oto.305.2020.03.10.15.56.13; Tue, 10 Mar 2020 15:56:25 -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=YKOsszmC; 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 S1727685AbgCJWzo (ORCPT + 99 others); Tue, 10 Mar 2020 18:55:44 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:46638 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726380AbgCJWzo (ORCPT ); Tue, 10 Mar 2020 18:55:44 -0400 Received: by mail-pf1-f196.google.com with SMTP id c19so159511pfo.13 for ; Tue, 10 Mar 2020 15:55:43 -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=9qaiYIGTi5RptJqzXrWrO9DTMLRu6kbwYuAs5GV2464=; b=YKOsszmC2lyMA3RjZ0DeD3vNrtWaqlI5vOA3Vfush2fXkbj/yWnZvPTqyRRq4OFqBk Rv/Vdwsc1Wi1hgpeXBRq0lNHpClk9Ej1iO85TzlkG5eGGbdFf8jcksXrQYmY849HCDU3 k437moOl5m9zlJlXvk1AlvmrGfcUUE2oW0RPSovgDH8PneLtaf+HP6zsnwEE7LvaaOuw JIRv5jnGANKljukAgZMJ3vLthCTJSGCZ9rmIu59CNZqaC8dPg4QibTmzXADvm5VcwScx y6WHqhU0Z8XZG6OzQnoLS8BrOvG87/B7EW09DGWari0G5uaMnyBxjxWwJlj28u2LAB2o M9rw== 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=9qaiYIGTi5RptJqzXrWrO9DTMLRu6kbwYuAs5GV2464=; b=OV8+l/FRmKKkmCTEvu5uhbtt2R/Fs7gnIjiasouSZiZmhKi9ejOCGEqR7rgl4M4mlQ I1BhcTxH1EOz/haRguhAQL7ltwbxlvbYDL286pnTp35SV2poIZWa7LTwlPby4xve4Jga 8qV7o77vWEHyqCKWkmRYt9MC5/2YLyKL5c1BHW7d9wDjjIuForsdSFprvJcoHwn5Jp19 /YQRmjYJ/oNDBi21rKukMrCd7tlS5EN+ZlL2/pDnWulKdbfExxN7L+JSxdXfPWVajFC2 Ismwuf9bWCyt0u6yLhxztNuoCnx5kBY+MNlh2JJ6+oObdTd7ryMQxOkd62KkHdAYOjmx CAkQ== X-Gm-Message-State: ANhLgQ2Yc95pR65JZ7bjI7s1qndAWvyeRwe5kJYk4thkqnFxxRL4DPC3 3HxWHBCUvCLMOpY3K+qH8P//UAeEybo= X-Received: by 2002:aa7:82d5:: with SMTP id f21mr24397468pfn.245.1583880943224; Tue, 10 Mar 2020 15:55:43 -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 h22sm47875432pgn.57.2020.03.10.15.55.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2020 15:55:42 -0700 (PDT) Date: Tue, 10 Mar 2020 15:55:41 -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: <0e5ca6ee-d460-db8e-aba2-79aa7a66fad1@I-love.SAKURA.ne.jp> Message-ID: References: <0e5ca6ee-d460-db8e-aba2-79aa7a66fad1@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 Wed, 11 Mar 2020, Tetsuo Handa wrote: > > diff --git a/mm/vmscan.c b/mm/vmscan.c > > --- a/mm/vmscan.c > > +++ b/mm/vmscan.c > > @@ -2637,6 +2637,8 @@ static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc) > > unsigned long reclaimed; > > unsigned long scanned; > > > > + cond_resched(); > > + > > Is this safe for CONFIG_PREEMPTION case? If current thread has realtime priority, > can we guarantee that the OOM victim (well, the OOM reaper kernel thread rather > than the OOM victim ?) gets scheduled? > I think it's the best we can do that immediately solves the issue unless you have another idea in mind? > > switch (mem_cgroup_protected(target_memcg, memcg)) { > > case MEMCG_PROT_MIN: > > /* > > >