From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A2AAC18E5B for ; Mon, 16 Mar 2020 09:32:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 14FD420658 for ; Mon, 16 Mar 2020 09:32:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 14FD420658 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A056D6B0005; Mon, 16 Mar 2020 05:32:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9DCCD6B0007; Mon, 16 Mar 2020 05:32:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8CC246B0008; Mon, 16 Mar 2020 05:32:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0251.hostedemail.com [216.40.44.251]) by kanga.kvack.org (Postfix) with ESMTP id 767836B0005 for ; Mon, 16 Mar 2020 05:32:40 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4D68C10FE0 for ; Mon, 16 Mar 2020 09:32:40 +0000 (UTC) X-FDA: 76600710480.01.rail06_1748f1170cf01 X-HE-Tag: rail06_1748f1170cf01 X-Filterd-Recvd-Size: 4776 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Mon, 16 Mar 2020 09:32:39 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id b2so13989403wrj.10 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=MkwDDFCf2+hP3O0/RRPFBK1GryaURd0KglsPE8IYFyfxIph3CTD5XvOrYyQkLPNc1m dRn8TmIcPgA2qVaCXn2egFeYgJk9FdbZdDQlYNlT22tMoNHrNR3utHCfCUlPdqw51hr9 aLzpIuuMuCiscaRgwzrR1us1gljy6ZmLxY/jaVYSaPABHsQ7ZMiYuBoYkeNw5utcTTl8 yvAdA9uxwafv1dECRo6+cTW40gmj7OHQLwexDPIqmibveHAo5OWcAyjMRfDLF7R9ypZQ 85Z2V9+tldLMbkg9fiYbsaSt+sXJ2Hk7KUwIWp5bt+YK8m0IaJxuOFwrHIpb5wnBgBWT XtlQ== X-Gm-Message-State: ANhLgQ1CTpg9DMMNgx4p0sWz67qAhQZIsaxweakpuqvd8mtcF8jcvxhl Mvhcmx3Tu5V0hIlBPCeHaL8= X-Google-Smtp-Source: ADFU+vt6YXM1CptagV/rpbnMHtj8W9qM4URMPJkfMe5NZq7b8cAbpDRqRecJiXokzAJI5m005xwVmQ== 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> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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