Received: by 10.213.65.68 with SMTP id h4csp842683imn; Tue, 27 Mar 2018 09:48:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Ck+1EKEBmzDhNI2CcgdvWZQfQUu2HDTPBhN4I3cbSQo/lq1cs0+6K+lHNqv6RvSXJAYSZ X-Received: by 10.99.4.202 with SMTP id 193mr30795pge.409.1522169283828; Tue, 27 Mar 2018 09:48:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522169283; cv=none; d=google.com; s=arc-20160816; b=PDtfYfCtOeCEwYVrkU9BLh0h013nCkP/4lrntCN7uabWU0PYiYpFO6sChS3XJhOB/K Thghs4jUeYutZFvedsQPTqX2gkaRpvzohQ1LEiKvNda7zXMgMSKkNrhHMupBM8fF+klP FIWWkhxxUrkdwixgKKgMo0E9sTjBBoRtpmzbYp9m7rUKDQcuCUKhrC3b43m5VsX3JIBf 1T/mtytQFFZ4HpaOAtDtJ49rMYJ8H+VOrsnE34WmwplUioiEplww1bOhmv2rqJ+Eh5fA dnGdZLUOy393sNw1Xlpbwe7uf8sho8Bp2WPB+WKELUwmdvF4sOTqadb8DXcur2QmHADR Ae+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=gIJ1Lkv16r1qMeTZc3UWnbSYEldGbCBKhdp1/qGvwok=; b=C50I09p3kbcV1Ye7LH+mSUgIWTzrfgAZilwzivy3GuRKlG312S9/85/qT43eSXOm4K VetVOImBuZm2Ek8FmJVGLXoCN/0CI2kTGp9ezuLRcvUKXsXsWTbq2m/UmHqBepAOGhn1 F+JVymyPkbZ+g30KS6QFbEZnb31NK5QXmioAkizmaUCsd5441Sm3UHcHp1Lk3K+Vw+/A RzirqSix0G39W6bLVtn3SYozp+NJEEz6FX8pwSamDwlc4tyv3yRSyY8oB0yTW+7wq2Nu ArQK9sJa84zqqh9baDxh4ftN0AmYa+iBQaUiRbyhiSq1SYdHBGFGtQxzBR7If6KNvfFE IUwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=PkuXKhWy; dkim=pass header.i=@codeaurora.org header.s=default header.b=PkuXKhWy; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u74si1143838pgc.264.2018.03.27.09.47.49; Tue, 27 Mar 2018 09:48:03 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=PkuXKhWy; dkim=pass header.i=@codeaurora.org header.s=default header.b=PkuXKhWy; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755735AbeC0QpN (ORCPT + 99 others); Tue, 27 Mar 2018 12:45:13 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:44712 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755722AbeC0QpJ (ORCPT ); Tue, 27 Mar 2018 12:45:09 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D7A04607E4; Tue, 27 Mar 2018 16:45:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522169108; bh=V9oFXMKNUJtNN9sG6LiQsapZ4plZZ4bTeIcgP05P3Uk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PkuXKhWyuzBX3VIBqitp2tUwXyyn1O7b3ZejwE/CX+zT/cYDnZiBlflcdfQpiOq7t WmifEVEQBu7ENKD9U6mYAB8AkVmHLKDUNTnBSIhjQURboAUpYKcHJtDwIiUL2Q92m/ YGqjeQg1ha7AAqQFuDIiBImqZ//EDKVv0CSd4V+s= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 32D52602FC; Tue, 27 Mar 2018 16:45:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522169108; bh=V9oFXMKNUJtNN9sG6LiQsapZ4plZZ4bTeIcgP05P3Uk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PkuXKhWyuzBX3VIBqitp2tUwXyyn1O7b3ZejwE/CX+zT/cYDnZiBlflcdfQpiOq7t WmifEVEQBu7ENKD9U6mYAB8AkVmHLKDUNTnBSIhjQURboAUpYKcHJtDwIiUL2Q92m/ YGqjeQg1ha7AAqQFuDIiBImqZ//EDKVv0CSd4V+s= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 28 Mar 2018 00:45:08 +0800 From: yuankuiz@codeaurora.org To: Tejun Heo Cc: cgroups@vger.kernel.org, lizefan@huawei.com, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, pkondeti@codeaurora.org, cgroups-owner@vger.kernel.org Subject: Re: [PATCH]cgroup: __cpuset_node_allowed return bool In-Reply-To: <20180326141212.GI2149215@devbig577.frc2.facebook.com> References: <0fee75e4a1b12f5fca30e04306a95788@codeaurora.org> <20180326141212.GI2149215@devbig577.frc2.facebook.com> Message-ID: X-Sender: yuankuiz@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-03-26 10:12 PM, Tejun Heo wrote: > Hello, John. > > On Sat, Mar 24, 2018 at 01:05:50PM +0800, yuankuiz@codeaurora.org > wrote: >> as a bool, __cpuset_node_allowed(...) return should be bool. > > So, as a minor cleanup patch, this is fine but can you please soften > the commit title / description a bit? It doesn't have to be bool. > int is fine. bool may be marginally more readable but that's about > it, so let's please make the commit match that. > [ZJ] On summary, update it as below: From 6fd65547d4c704d86fd98cac1d9b8c74c8bee879 Mon Sep 17 00:00:00 2001 From: John Zhao Date: Sat, 24 Mar 2018 13:01:32 +0800 Subject: [PATCH] cgroup: allowed of __cpuset_node_allowed to be bool makes variable allowed returned by the __cpuset_node_allowed(...) to be bool as it is assigned by the test_bits which always return 0 or 1. In addition, it could save the size from typical 4 bytes to 1 byte only. In another side, it could save the potiential unnecessary instructionis during type conversion. Signed-off-by: John Zhao --- kernel/cgroup/cpuset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index b42037e..42338b7 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -2552,7 +2552,7 @@ static struct cpuset *nearest_hardwall_ancestor(struct cpuset *cs) bool __cpuset_node_allowed(int node, gfp_t gfp_mask) { struct cpuset *cs; /* current cpuset ancestors */ - int allowed; /* is allocation in zone z allowed? */ + bool allowed; /* is allocation in zone z allowed? */ unsigned long flags; if (in_interrupt()) -- 2.7.4