Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp25987ybh; Fri, 13 Mar 2020 16:16:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsd/6LRfAOwyy9Ltw+B1wnelcYofWJwZ7UCGTzOdv88R17j9CO/EmkpJFRKuPLZlo6BZ7We X-Received: by 2002:aca:5b07:: with SMTP id p7mr8665758oib.146.1584141397457; Fri, 13 Mar 2020 16:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584141397; cv=none; d=google.com; s=arc-20160816; b=jrflzlUfW8J4y5WAf18Pl1c2QZv0eV1VmSRP+JSN9IIydFq0B9k/Ed8dh9OF4A4R7b VsRU+QINyhuP3Ti8sjJ8geG6nsZXISkO5Tm1kJFFXhcRSiGyGHXNTbzXn2nO8+vqx0qF nw47ks0QWeUTUhos5p2WHWR3+btqeVFOn746e+xrNJ6pHyy/rARK8IKEQrYxzMY65fPC 6lyeyRCZoYRo/VOd+UA/SRykBRUEfkJwPRh1Ri+7iHeqsN/JA+RFx5gOWDr3BQqGEEw5 AXi97Xccpb/g+ULSzun6BsLg9wFOSeZhb+PHWDId4jdaIndZIlvj8+Nw47W/W76Hqh9N THBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=duAjM5mHbzwRgAlz2etslT7/jqw7wCZN97VDo6JdtRk=; b=s5fvNlztauxbrvqBEWsNJcgGL2g63Zl0X2I31dKwkDWn6hrE1N1aKkgUiGio7fVcP2 HBAkW0XKIKUz113ZkX6V2BZRMzP5furhN1q4WfOFQ45Bm4kiAaok42fNoQ4pq66S1vZm hnd7JDMV6XQLZwKMBXxRY0US5JZtz+cpt0AqKQBsoLBcutULa6cvlTfjlTGAegqWW0kw nVWe9EIcW0Db5857GV2lWmefXVuSAkTMqfyKc/Xo3IyKzJhcSKWlKYzhpmUrtrD46RX3 ihQsVLwfKDOgV0CU6EiPj4k7+16lIbCzNTzUHfHEAwUVM3IzPdh88kfm4q+gf/vUQGR+ PvSw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j11si5209869ota.85.2020.03.13.16.16.23; Fri, 13 Mar 2020 16:16:37 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726837AbgCMXP5 (ORCPT + 99 others); Fri, 13 Mar 2020 19:15:57 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:55895 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726736AbgCMXP5 (ORCPT ); Fri, 13 Mar 2020 19:15:57 -0400 Received: from fsav405.sakura.ne.jp (fsav405.sakura.ne.jp [133.242.250.104]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 02DNFZl8040143; Sat, 14 Mar 2020 08:15:35 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav405.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav405.sakura.ne.jp); Sat, 14 Mar 2020 08:15:35 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav405.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 02DNFZr8040140 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Mar 2020 08:15:35 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [patch] mm, oom: prevent soft lockup on memcg oom for UP systems To: David Rientjes Cc: Andrew Morton , Vlastimil Babka , Michal Hocko , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <202003120012.02C0CEUB043533@www262.sakura.ne.jp> <202003130015.02D0F9uT079462@www262.sakura.ne.jp> From: Tetsuo Handa Message-ID: Date: Sat, 14 Mar 2020 08:15:32 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/03/14 7:01, David Rientjes wrote: > The entire issue is that the victim never gets a chance to run because the > allocator doesn't give it a chance to run on an UP system. Your patch is > broken because if the victim is current, you've lost your golden > opportunity to actually exit and ceded control to the allocator that will > now starve the victim. > I still cannot understand. There is no need to give CPU time to OOM victims. We just need to give CPU time to the OOM reaper kernel thread till the OOM reaper kernel thread sets MMF_OOM_SKIP to OOM victims. If current thread is an OOM victim, schedule_timeout_killable(1) will give other threads (including the OOM reaper kernel thread) CPU time to run. That is similar with your cond_resched() patch (except that cond_resched() might fail to give other threads CPU time to run if current thread has realtime priority), isn't it? So, please explain the mechanism why cond_resched() works but schedule_timeout_killable(1) cannot work.