Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1430242pxu; Fri, 16 Oct 2020 11:44:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMqGJTfZNk7NdWfTeq02UzJzxleH9TpgFPKj48EHG842NOStHGNrr1+aMQcwIPPYgzq3ib X-Received: by 2002:a17:906:1418:: with SMTP id p24mr5279762ejc.46.1602873863322; Fri, 16 Oct 2020 11:44:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602873863; cv=none; d=google.com; s=arc-20160816; b=mKlns8/PZaFLNyfWTU5MHyPmp8OFexn8wZmNSz2Wv4gEuXsoDs4aOzFd1i3fG0KPFh 492/UKoud6aYMaydQW5l+XIAhjOb3CeizRSlaNaoq75xfJaezqE1hMQ++ezEtw8xttr9 XntuQ8tFgoH1oWSP3JmRk4u8uZhKW6leWw7xH+++M0SvOY4uFC47ehD1JphdpHyiF93W Vqv+mqmRAztCn9tbwx6RlVEIxbWSTqQMQMevpvizEs7nG2AWQCK5zMq3f77yHeD53VsS FQt0hykk4wfD8abXpDxw+yQHZy8GbkYHORzS1Wht6TQDC1hAok9Jp8I8WLUdHyuSgOAA IuTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=6owtluUm+KAAtr8zT1LpykmDN98fiC6lKlFKpX401rE=; b=h15SAXmZsrcSFM9jHXicftSE7sYWhT4Qn6rR414gmTCdw7g5hoOhlpgZuqzWTVVDaD +wUY12R4wNoalx526fejn9PGyOSd3Z8FKdsGuaygbT5K2oqnO3HyX/K99UHR0eZnup02 EeDXmS6VTqh58ypRvSMdsdg59K/3YV0mRLJF5R5gNX7GC2IzKGCssc78w9SA8/McPLr4 PEPI9i4Ps9vjvqtCnKEflxtU7Xp9/UUbmVkvUNDIy2RtuBsbbdTXu0RhAxngwyQX+AFT IBUa0HTevMh4I/mgv5Mr2UgfIJDr4d+1wcmwnDAUAE+BWpNMhBYomWERqbhmfwSM+C8G l59Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si2467358eje.479.2020.10.16.11.44.01; Fri, 16 Oct 2020 11:44:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408901AbgJPOdw convert rfc822-to-8bit (ORCPT + 99 others); Fri, 16 Oct 2020 10:33:52 -0400 Received: from smtp.h3c.com ([60.191.123.50]:14970 "EHLO h3cspam02-ex.h3c.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405999AbgJPOdw (ORCPT ); Fri, 16 Oct 2020 10:33:52 -0400 Received: from DAG2EX10-IDC.srv.huawei-3com.com ([10.8.0.73]) by h3cspam02-ex.h3c.com with ESMTPS id 09GEX97X045540 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 16 Oct 2020 22:33:09 +0800 (GMT-8) (envelope-from tian.xianting@h3c.com) Received: from DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) by DAG2EX10-IDC.srv.huawei-3com.com (10.8.0.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 16 Oct 2020 22:33:13 +0800 Received: from DAG2EX03-BASE.srv.huawei-3com.com ([fe80::5d18:e01c:bbbd:c074]) by DAG2EX03-BASE.srv.huawei-3com.com ([fe80::5d18:e01c:bbbd:c074%7]) with mapi id 15.01.1713.004; Fri, 16 Oct 2020 22:33:13 +0800 From: Tianxianting To: Michal Hocko 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() Thread-Topic: [PATCH] mm: vmscan: avoid a unnecessary reschedule in shrink_slab() Thread-Index: AQHWo29cMaRbAMdQE0ycFn5GylDeeqmZnPOAgACJFdD//4YYAIAAiVZw//+CoICAAJNtUA== Date: Fri, 16 Oct 2020 14:33:13 +0000 Message-ID: References: <20201016033952.1924-1-tian.xianting@h3c.com> <20201016120749.GG22589@dhcp22.suse.cz> <9a2b772b13f84bdd9517b17d8d72aa89@h3c.com> <20201016130208.GI22589@dhcp22.suse.cz> <8a25eacf4b37460897911ade338754d3@h3c.com> <20201016134457.GM22589@dhcp22.suse.cz> In-Reply-To: <20201016134457.GM22589@dhcp22.suse.cz> Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.99.141.128] x-sender-location: DAG2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-DNSRBL: X-MAIL: h3cspam02-ex.h3c.com 09GEX97X045540 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for the explain. I got it. -----Original Message----- From: Michal Hocko [mailto:mhocko@suse.com] Sent: Friday, October 16, 2020 9:45 PM To: tianxianting (RD) 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() On Fri 16-10-20 13:20:41, Tianxianting wrote: > Thanks > I understood what you said :) > But whether it is proper to check reschedule in every loop when lock is taken? I do not see any actual problem TBH. cond_resched is mostly to increase interactivity for non preemptible kernel. It can reduce throughput but this is a memory reclaim path and I do not expect this to contribute to any moderate hot paths. Direct reclaim doesn't really count as a hot path. -- Michal Hocko SUSE Labs