Received: by 10.213.65.68 with SMTP id h4csp1447678imn; Mon, 26 Mar 2018 07:43:40 -0700 (PDT) X-Google-Smtp-Source: AG47ELuFFVN18EPIjR1RFyqjw/to3knm1vO66aIprg/50YulYfylizXItTQXv4PvHd/Te1n8Nqtp X-Received: by 10.98.57.143 with SMTP id u15mr33360834pfj.79.1522075420066; Mon, 26 Mar 2018 07:43:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522075420; cv=none; d=google.com; s=arc-20160816; b=Ymz7Vm8rlp9bfB0MB7cpxzTpyFYaU4qrELEfagF20uO6XhnfzMpPsHGn3WfmBrBiDx 3TUxKtcrIT3kieDEhY26wUhYdAIwLdQQRnOCW09xJgFpcb+QJciXxH4Mnmtnl78VGjKG eDVat3Q4WWadAlUv5uTnL0q7iz27k6kMHjH2VbjYuJZn2+PLspTm1H+dUD7foFl1xn4Q IwGhKn4JHZ/iO4DISio4WVmtaH0a7jj+QQEX0LdDPvo5DRKe2EiWOw8WyOHmUIaPDq0Z 7CXZi4kqHm4auovGFEIUZfAYwLZo3kPBsTOpW0tjxgPEMT7zTnslDDa+yQ6A3V+tbqow qwhQ== 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=4qr0vx4KOM3CjjD/HCyW4S28q6lzADlnYKdMO+jpLbo=; b=kN4t/tiVIObnjNogO7R5QHd5YfVSh83eeNEk8NdnPTGn7iXXbx8CDGYd67c2lVJOpT umUnrIRbVOguiY+4uYxp1g7oTZ1MkDNX7As95pf9eb0a3eIe9ak+O+AKMW9qpLEQPv0/ v/qIxcwZRDvWJ0Qs/l0rzzXVJ7vquMU4E803Te3wr9iTIdyVIHcZxdOA6fWFhK6wOTea ypNOkwD/xV85z8pSGZOOU6OgSaiFzGmWSvoWyvN/vgeM7rjrVEdiSS00egVRiwqAwOkt 6HtRPFg9JXG6w7Z3rzkHsWWxKlmhI5TQUbJr+F9+dxCL9/y2mjO9HkQ0AdSL677V/NVx 9grw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=fWezvepx; dkim=pass header.i=@codeaurora.org header.s=default header.b=fWezvepx; 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 d10si10310995pgu.531.2018.03.26.07.43.24; Mon, 26 Mar 2018 07:43:40 -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=fWezvepx; dkim=pass header.i=@codeaurora.org header.s=default header.b=fWezvepx; 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 S1752439AbeCZOmB (ORCPT + 99 others); Mon, 26 Mar 2018 10:42:01 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:52762 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752374AbeCZOmA (ORCPT ); Mon, 26 Mar 2018 10:42:00 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 826BA607DD; Mon, 26 Mar 2018 14:41:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522075319; bh=+9XNC5De/SWRnqSMAYAMmQQ9VDCEETYmwib/vXHw+HU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fWezvepxuzvHiTLVfDH56POfOlNMJ1890fBs0QwgKLr17UZALV4+LfxyKKMeEZ8Mv jf7V+BEKO3aEBXTBe1XK5nXq0se4DxfXXt4JX1czdMxfe/P80x6AE2emKjAEYsgDTs AXK7NwUHPSyM++ZgsjgUp9JGnT/tX2XJBXwhN7qA= 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 22A2160390; Mon, 26 Mar 2018 14:41:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522075319; bh=+9XNC5De/SWRnqSMAYAMmQQ9VDCEETYmwib/vXHw+HU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fWezvepxuzvHiTLVfDH56POfOlNMJ1890fBs0QwgKLr17UZALV4+LfxyKKMeEZ8Mv jf7V+BEKO3aEBXTBe1XK5nXq0se4DxfXXt4JX1czdMxfe/P80x6AE2emKjAEYsgDTs AXK7NwUHPSyM++ZgsjgUp9JGnT/tX2XJBXwhN7qA= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 26 Mar 2018 22:41:59 +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: References: <0fee75e4a1b12f5fca30e04306a95788@codeaurora.org> <20180326141212.GI2149215@devbig577.frc2.facebook.com> <3540bc7869927f54c409b697c743938a@codeaurora.org> <20180326142527.GJ2149215@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 Hi Tejun, Additionally, On 2018-03-26 10:37 PM, yuankuiz@codeaurora.org wrote: > Hi Tejun, > > inline. > > On 2018-03-26 10:25 PM, Tejun Heo wrote: >> On Mon, Mar 26, 2018 at 10:20:43PM +0800, yuankuiz@codeaurora.org >> wrote: >>> 1) return int type variable in bool function: >>> bool enabled() >>> { >>> int ret = 1; >>> return ret; >>> } >> ... >>> 2) >>> bool enabled() >>> { >>> bool ret = 1; >>> return ret; >>> } >> ... >>> so the #1) style function can generate significant instructions >>> than the #2). >> >> That is a problem for the compiler, not the code. [ZJ] Actually, it should be bool but not int. Without any optimization by compiler, it is the best if it is the same as returned. >> >>> While, this is happened only when "-On" is not used with *-gcc >>> together. Though, it is oftern there, it is best to provide this >>> with decoupling of which option is used for optimization. >> >> We don't want to dictate minute coding styles to avoid things which >> are trivially optimized by compilers. > [ZJ] Optimized by compiler is observed only. Such as it is not so big > difference in x86-arch. > >> >> Thanks. > -- > To unsubscribe from this list: send the line "unsubscribe cgroups" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Thanks, BR//Zhao