Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932454AbbKRMn4 (ORCPT ); Wed, 18 Nov 2015 07:43:56 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:36836 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752988AbbKRMnx (ORCPT ); Wed, 18 Nov 2015 07:43:53 -0500 Message-ID: <1447850630.22599.140.camel@edumazet-glaptop2.roam.corp.google.com> Subject: Re: net-scm: Macro for special pattern? From: Eric Dumazet To: SF Markus Elfring Cc: Daniel Borkmann , netdev@vger.kernel.org, "David S. Miller" , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Julia Lawall Date: Wed, 18 Nov 2015 04:43:50 -0800 In-Reply-To: <564C2CB5.5010507@users.sourceforge.net> References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <564B5937.1070707@users.sourceforge.net> <564B602F.2020302@iogearbox.net> <564B6C6F.3070809@users.sourceforge.net> <564B73D7.7040501@iogearbox.net> <564C2CB5.5010507@users.sourceforge.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 907 Lines: 25 On Wed, 2015-11-18 at 08:45 +0100, SF Markus Elfring wrote: > > You mean this likely() annotation of yours? > > How do you think about to express the software design pattern > which is applied at the mentioned source code place by a dedicated > preprocessor macro? likely()/unlikely() are not always applicable. In the Ipv6 case I mentioned to you, it all depends if an application for some reason absolutely wants the sockets to store the extra skb There are seldom used socket options. _if_/_when_ they are used, a likely()/unlikely() would give the wrong signal. likely() should only be used in contexts we know better than branch predictor/compiler. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/