Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3112564pxx; Sun, 1 Nov 2020 23:31:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyv9b9x5GHrFmhIZTiUO0O019hZ0HXqJ/YzfSrsOVBqMWGnLTeN8d3pSkqzx2nb5ele+oYB X-Received: by 2002:aa7:d514:: with SMTP id y20mr11059003edq.384.1604302287493; Sun, 01 Nov 2020 23:31:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604302287; cv=none; d=google.com; s=arc-20160816; b=Eb4CL3oz4t+WFsF8fhXqb+ya9t/kV5oq7IoMGdbylbTDDImwnfuT1xQGwuakdTMaF/ lcKXEqCY3Lk7jAZR9zthYclvNVXZ+Vaun6Ft2uwrVk+6VH5h0ed16+WsfY0c8ek2rEp8 Wxb/VwBAuyqGcvPHjaqlTkhpIfM1rifcq4uP6ctFyfPSdYc5Uc+qz4zY4xuTHk0yPRlY 6AdwuqxJ+9RtGEnIs2Urs+nyO9tR32efYMIOMG0BVsZQkB0yOgfiSzulsc3w/Nvc40qx NR7g4Hof1ZcwyJIKRDE91WL7HLA2o+LMqYAC+GFKNgLQcyLxA8NbvMlJTBl1Pc0TCeTn UzTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vIeSJu/dxQMs46dPuG/9Z0PrnYcPG7vnkDWSjn2yCPc=; b=qLLNrzLJN9XATeIrOnB4HSy6z7D3dKiskLIsuC42DXQdoSdzwlFAd2mR1ni0eh9iRv j1jDKuOvwbyp27/zqkUQCIdnehnkUNc4Rur/9Xb274XxesrhCa9PZYAyLLus66G6CNBn b+t+nND2uv1687sffwX/E/76iyUbor8zxu82cmpakPPNSYoeznn61Ry2mcff+mhLle7G f9fDUX84OZR4BoL5tK2ZQpWZl+W0EFblv3UbQ9w0pzhEe5zeNcHynPTVykOJQL3PrMpG cfY8sWk5aFrNQgPG/FAmYBv1iI3JMOubu4T3t+GHnmezsJt8Jcc+ngQpkRtpRATzSoHL KUUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=t3kkl6+B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si123096ejp.348.2020.11.01.23.31.05; Sun, 01 Nov 2020 23:31:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=t3kkl6+B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727902AbgKBH2k (ORCPT + 99 others); Mon, 2 Nov 2020 02:28:40 -0500 Received: from mx2.suse.de ([195.135.220.15]:42832 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727802AbgKBH2k (ORCPT ); Mon, 2 Nov 2020 02:28:40 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1604302118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vIeSJu/dxQMs46dPuG/9Z0PrnYcPG7vnkDWSjn2yCPc=; b=t3kkl6+BY+//ALDZFl4LH/zzn9lEK17PsBuQJOG4gFXTiEhMJtwEHDKk+6PBTvXUMY4qFF aOTAr32BOyEFFBx3huA3vrGlZfq49MNUifeOFqftPzL/YnudR8gNPUEuuEmMOXSTlQDfUd A2a6nupcbgZrgV91Fz//CP4kH6/8f/8= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4EE79ACF6; Mon, 2 Nov 2020 07:28:38 +0000 (UTC) Date: Mon, 2 Nov 2020 08:28:36 +0100 From: Michal Hocko To: Hui Su Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] mm/oom_kill: change comment and rename is_dump_unreclaim_slabs() Message-ID: <20201102072836.GA22613@dhcp22.suse.cz> References: <20201027144529.GA3558@rlk> <20201027145814.GY20500@dhcp22.suse.cz> <20201027151156.GA4336@rlk> <20201027192322.GA20500@dhcp22.suse.cz> <20201028153141.GB77196@rlk> <20201030182704.GA53949@rlk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201030182704.GA53949@rlk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 31-10-20 02:27:04, Hui Su wrote: > Change the comment of is_dump_unreclaim_slabs(), it just check > whether nr_unreclaimable slabs amount is greater than user > memory, and explain why we dump unreclaim slabs. > > Rename it to should_dump_unreclaim_slab() maybe better. > > Signed-off-by: Hui Su Acked-by: Michal Hocko Thanks! > --- > mm/oom_kill.c | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > index 8b84661a6410..04b19b7b5435 100644 > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -170,11 +170,13 @@ static bool oom_unkillable_task(struct task_struct *p) > return false; > } > > -/* > - * Print out unreclaimble slabs info when unreclaimable slabs amount is greater > - * than all user memory (LRU pages) > - */ > -static bool is_dump_unreclaim_slabs(void) > +/** > + * Check whether unreclaimable slab amount is greater than > + * all user memory(LRU pages). > + * dump_unreclaimable_slab() could help in the case that > + * oom due to too much unreclaimable slab used by kernel. > +*/ > +static bool should_dump_unreclaim_slab(void) > { > unsigned long nr_lru; > > @@ -463,7 +465,7 @@ static void dump_header(struct oom_control *oc, struct task_struct *p) > mem_cgroup_print_oom_meminfo(oc->memcg); > else { > show_mem(SHOW_MEM_FILTER_NODES, oc->nodemask); > - if (is_dump_unreclaim_slabs()) > + if (should_dump_unreclaim_slab()) > dump_unreclaimable_slab(); > } > if (sysctl_oom_dump_tasks) > -- > 2.29.0 > > -- Michal Hocko SUSE Labs