Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp906768ybh; Thu, 12 Mar 2020 13:18:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuptfRjJZ19/FoM7FaA9mqWipUDveFA8rYkvM6PtWrNROBZsdSUWG9cfWL1n3cPRKyEzWr0 X-Received: by 2002:a9d:2c44:: with SMTP id f62mr8176780otb.7.1584044330880; Thu, 12 Mar 2020 13:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584044330; cv=none; d=google.com; s=arc-20160816; b=gjX3+DRxvlLqUuXH4bHDakv3arEyZ2fFbEY/W4oxiwII/xh5myqDLbyiPDJbMK8Hyc fYsCyOcm+OJbIpM/CmS2cDB3JGj3yi0XOtti4FU3ynd5I7/DkPhL95PrEofWGlEwWEFp P+24S4X1Qtt36B91JIR+AwR7uQ5PvUS245c0KgcerBWJJnV/uGQeDf7zJtXufOI9Ms/W hnmiIJV6CBAz4Y9C0dWxUerX4KMRi1/eVFzyOZ7Zc92jzG8TusO8aPKo0OzWmQYc1YBv x0ZjsjshnqFNpvjCSemzplYtgVVkEjc4Z+90SraEehSpJoSLk7UlREVRiYhsuqM/m+M3 CxmQ== 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=yLZW/qZRAwj/qZJYLmvntwJ6WgyWrrnV7NOpGpMsiCs=; b=xUZmi8N0B4KXKVFWk5ZZ0c8gesvi064Ubc3Ey/NfFo/+HvxLimhKM6NAQFQE2oIK8k V4gkskY/oUDQaoyBPDyaQT33r1blJ61tqBAvZ6QRR0Z/hKPZob5ffcRX4zrr6IvsWelh X1uhzQg9XCinC5EQSUgZRuUhW9/jI7ovWkM6vmAg1C0IwxNlqBOjxi1o/IoWPcNpCv5R iFN1VMZEvKHghXm7yfAn+PYToMh8SWJESZsKtmbL/Xe3I99Fuq31r8DsdB6iympiB8KD thnVE01vnQfOB8lixnlmujToj/V3oJTdoQXb9e5v0NbwRSdlYb1Q4UIllUqWADgsL1m3 AeUw== 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 j68si3399898otj.56.2020.03.12.13.18.37; Thu, 12 Mar 2020 13:18:50 -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 S1726890AbgCLUQ2 (ORCPT + 99 others); Thu, 12 Mar 2020 16:16:28 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:50631 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726558AbgCLUQ2 (ORCPT ); Thu, 12 Mar 2020 16:16:28 -0400 Received: by mail-wm1-f66.google.com with SMTP id a5so7550619wmb.0 for ; Thu, 12 Mar 2020 13:16:27 -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=yLZW/qZRAwj/qZJYLmvntwJ6WgyWrrnV7NOpGpMsiCs=; b=jbV8E88NLQfbdkS5DY1hzLENcONNrR0k9Pwhzs7tkxp9eZ6d2bsxc1adv190rwQWtL XNfi9B7ftJW8lfcB1nIDV+clmE73IhaEOsFt1IwGvOy3xGpsb4CPSpoa8wRl9EC7c7pS TLFRPEyILOXy75AgkcWaqEPDQ7tGlwRd0lo4Jz+fr/tw+4X38k8gCgG3sJcxrVP7EcR6 SBzvPmSk1YwGBkxH5YjBi3+9i4jSwPzSxJODV1B8iOKV1swggOAkTj+EOEGpbhdQmj+E tG4iBZG6y04VpKJ5r8bfQniryKnj/aD6sGuISv6KCKjPBOVEhsGP/Gt/7ww8Hcwc+Q9n 2ETQ== X-Gm-Message-State: ANhLgQ0+LhEg5CUvGQ5Nw15/DHRcgHwQCosG5xDJ0vZVxnz9y7PBYXFZ Hmhskg1Ixv4wUt0pk+ENthtlZmNT X-Received: by 2002:a1c:9602:: with SMTP id y2mr6345011wmd.23.1584044186750; Thu, 12 Mar 2020 13:16:26 -0700 (PDT) Received: from localhost (ip-37-188-253-35.eurotel.cz. [37.188.253.35]) by smtp.gmail.com with ESMTPSA id i10sm70877339wrn.53.2020.03.12.13.16.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 13:16:25 -0700 (PDT) Date: Thu, 12 Mar 2020 21:16:24 +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: <20200312201624.GD23944@dhcp22.suse.cz> References: <20200310221019.GE8447@dhcp22.suse.cz> <20200311082736.GA23944@dhcp22.suse.cz> <20200312083241.GT23944@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > 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