Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1265039pxu; Fri, 16 Oct 2020 07:57:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoX3Auxpb2nm/6n3uLkMp/15hhD51KLz10MayWxc/njIN7u7mfggtHPyI9CNvYFnvrEKfs X-Received: by 2002:a17:906:b858:: with SMTP id ga24mr4076680ejb.378.1602860230941; Fri, 16 Oct 2020 07:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602860230; cv=none; d=google.com; s=arc-20160816; b=F3a6MV3dZWo1do7gI4ssZSHKuzqrEcXBw6Zv95AYWdY8bDFGf88CV2ltiOnNSp/UqR vIy3z4AxzwwSLE2EJsWhcTQZV5wRZKG7WFC4i1BGfT5/u1iw0Gvbax3CMZXSOXfa2zWc tBg6zoQnMUxcsEh+jKZTMd7WeTu5+la7AODHmbFLwIZ9NIQfEDmcGsfXzLDhqkBZ0xAL HMk6oRN/lp/Mv2IdaiQe0W4sd7vfwu+MiDNY47p2tySuP8gvJUIErTh3GX5uDxtFGZ+4 vq6STVNpQgVWLKT2/jYql356Y8+zbfGloSmcd68lLnyYgX9WbYUS9lCs6A8EnIVnGipV I+6g== 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=aMvmrgpjMkX0xJOTXr8Pz+UkBkQEErVHRE0b+uty4jo=; b=KMeYVSPRiBJ9cVjtTgHFbJNoBx+nh1vGNIauHasv/QvduQNpTTA58HZtDYe651pdgZ wMfIcliOKr+8HlN8LUnVmvK9+/o0FGkccYRbXLR+b1ObLhG4rWPjjQ64v+opwLNOuiLj wBb6tBwJarmTZuuwtbk/3hyUaaT3c8e2jEliJnr42U1ZZmE8IiDWJDjfCjqicBopW8rR YYYeAA+UH2IV/VRB5wPpJuQJxohIBrZADwskRmLeOJPgNPX/iK7MO6KTSnFigyw/ermj yvCRW/c4xFdum/sT6tz6gAefENGTTG2Ju/1kCG+oO0Gg0pXQ/ZwaLtrmGNUxF/8mbOoE NaEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=MsTJuYeF; 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 94si1959133edp.211.2020.10.16.07.56.48; Fri, 16 Oct 2020 07:57:10 -0700 (PDT) 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=MsTJuYeF; 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 S2407201AbgJPMHz (ORCPT + 99 others); Fri, 16 Oct 2020 08:07:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:43528 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407197AbgJPMHy (ORCPT ); Fri, 16 Oct 2020 08:07:54 -0400 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=1602850073; 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=aMvmrgpjMkX0xJOTXr8Pz+UkBkQEErVHRE0b+uty4jo=; b=MsTJuYeFBaY1lUdcdwkieCiuRiuoHH/KEexOXZihB/7wj6fcen0rY7ib52Q8Q9Vd+dsEmk /xagWKCpLyntf1KWzA+EwuUbRbMPqd4ABTRuAvoj2TqI0Muh7oPpZLre7+yc+Ab91dliAV RFNaoo1GdLos0vZygjYfSC83Q9IcmdI= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 785A6AD72; Fri, 16 Oct 2020 12:07:53 +0000 (UTC) Date: Fri, 16 Oct 2020 14:07:49 +0200 From: Michal Hocko To: Xianting Tian Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: vmscan: avoid a unnecessary reschedule in shrink_slab() Message-ID: <20201016120749.GG22589@dhcp22.suse.cz> References: <20201016033952.1924-1-tian.xianting@h3c.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201016033952.1924-1-tian.xianting@h3c.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 16-10-20 11:39:52, Xianting Tian wrote: > In shrink_slab(), it directly goes to 'out' label only when it > can't get the lock of shrinker_rwsew. In this case, it doesn't > do the real work of shrinking slab, so we don't need trigger a > reschedule by cond_resched(). Your changelog doesn't explain why this is not needed or undesirable. Do you see any actual problem? The point of this code is to provide a deterministic scheduling point regardless of the shrinker_rwsew. > > Signed-off-by: Xianting Tian > --- > mm/vmscan.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 466fc3144..676e97b28 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -687,8 +687,9 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid, > } > > up_read(&shrinker_rwsem); > -out: > + > cond_resched(); > +out: > return freed; > } > > -- > 2.17.1 > -- Michal Hocko SUSE Labs