From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id 5F50CC41C for ; Wed, 21 Oct 2015 17:53:53 +0200 (CEST) Received: by wikq8 with SMTP id q8so100221033wik.1 for ; Wed, 21 Oct 2015 08:53:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=v68gDLLBhcQ6KhI9iiB48ju77XVkCSafzfHS4cQwP7g=; b=Jj9xNF5LKHPNgnr4Ijp3mG3FUHHRk7GrPM/jTb2a3rFEnnsOYZW7NPvAtEJx4GbpV/ W/bMQlJtBxnJcI+LnHlQG+KogRPcY+lvMZBYHB1zPThjrU5UfSE80Y37m0XKtWUyzjHz O/PV04EORlwZaABKPI9tXvmwUQ6/xeBCU83WV5X2ZylmTTDuasdnwhjrG+QwHIIBOgts DynG7fBM+0lQc6F9CF/TLSLihy4U59C5pT+yOQSRAFt3+mHYSQJKTyXfm/65i2KA+voH TC2Pv9/KjWBne7LoEw6DrwuDE2a3XY9AI0H3Mpa/IoMTCnKprQQbwROnC0L1WDPZEz3O Mx5Q== X-Gm-Message-State: ALoCoQm32EHlSz0FLANyS/uozX8jBlzwzwx3jo2qSZsnFNA81nV+ROsLYHzbgSv1B+Jd4WnoyLK1 X-Received: by 10.180.39.178 with SMTP id q18mr11656086wik.57.1445442832959; Wed, 21 Oct 2015 08:53:52 -0700 (PDT) Received: from xps13.localnet (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id jt3sm875296wjc.12.2015.10.21.08.53.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Oct 2015 08:53:52 -0700 (PDT) From: Thomas Monjalon To: Stephen Hemminger Date: Wed, 21 Oct 2015 17:52:47 +0200 Message-ID: <2344789.5MT16lH3ET@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <20151021084747.6c2ca303@xeon-e3> References: <1445399294-18826-1-git-send-email-yuanhan.liu@linux.intel.com> <2601191342CEEE43887BDE71AB97725836AB321F@irsmsx105.ger.corp.intel.com> <20151021084747.6c2ca303@xeon-e3> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org, "marcel@redhat.com" , "Michael S. Tsirkin" Subject: Re: [dpdk-dev] [PATCH v7 4/8] vhost: rxtx: use queue id instead of constant ring index X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2015 15:53:53 -0000 2015-10-21 08:47, Stephen Hemminger: > On Wed, 21 Oct 2015 09:38:37 +0000 > "Ananyev, Konstantin" wrote: > > I also don't understand what's wrong with using 'always_inline' here. > > As I understand the author wants compiler to *always inline* that function. > > So seems perfectly ok to use it here. > > As I remember just 'inline' is sort of recommendation that compiler is free to ignore. > > Konstantin > > I follow Linux/Linus advice and resist the urge to add strong inlining. > The compiler does a good job of deciding to inline, and many times > the reason it chooses for not inlining are quite good like: > - the code is on an unlikely branch > - register pressure means inlining would mean the code would be worse > > Therefore my rules are: > * only use inline for small functions. Let compiler decide on larger static funcs > * write code where most functions are static (localized scope) where compiler > can decide > * reserve always inline for things that access hardware and would break if not inlined. It would be interesting to do some benchmarks with/without "always" keyword and add these rules in the coding style guide.