From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 438C75F28 for ; Wed, 14 Mar 2018 14:06:39 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Mar 2018 06:06:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,470,1515484800"; d="scan'208";a="24591182" Received: from klaatz-mobl.ger.corp.intel.com (HELO [10.237.220.60]) ([10.237.220.60]) by orsmga007.jf.intel.com with ESMTP; 14 Mar 2018 06:06:36 -0700 From: "Laatz, Kevin" To: Vipin Varghese Cc: dev@dpdk.org, harry.van.haaren@intel.com References: <1519762085-77659-1-git-send-email-vipin.varghese@intel.com> Message-ID: <39dc23d4-bac3-7571-eaa8-a05c9f793efc@intel.com> Date: Wed, 14 Mar 2018 13:06:35 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1519762085-77659-1-git-send-email-vipin.varghese@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] event/sw: add unlikely branch predict X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2018 13:06:39 -0000 On 27/02/2018 20:08, Vipin Varghese wrote: > For most run cases 'sw->started' holds true. Adding a branch prediction > suggestion to compiler helps as this is first conditional check just > after entering the function. > > Signed-off-by: Vipin Varghese > --- > drivers/event/sw/sw_evdev_scheduler.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/event/sw/sw_evdev_scheduler.c b/drivers/event/sw/sw_evdev_scheduler.c > index 3106eb3..17bd4c0 100644 > --- a/drivers/event/sw/sw_evdev_scheduler.c > +++ b/drivers/event/sw/sw_evdev_scheduler.c > @@ -508,7 +508,7 @@ sw_event_schedule(struct rte_eventdev *dev) > uint32_t i; > > sw->sched_called++; > - if (!sw->started) > + if (unlikely(!sw->started)) > return; > > do { Acked-by: Kevin Laatz