[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1438338481.19675.72.camel@perches.com>
Date: Fri, 31 Jul 2015 03:28:01 -0700
From: Joe Perches <joe@...ches.com>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: yalin wang <yalin.wang2010@...il.com>,
"Kirill A. Shutemov" <kirill@...temov.name>,
Andrew Morton <akpm@...ux-foundation.org>,
linaro-kernel@...ts.linaro.org,
open list <linux-kernel@...r.kernel.org>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
David Rientjes <rientjes@...gle.com>,
Ebru Akagunduz <ebru.akagunduz@...il.com>,
Johannes Weiner <hannes@...xchg.org>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
"open list:MEMORY MANAGEMENT" <linux-mm@...ck.org>,
Mel Gorman <mgorman@...e.de>, Michal Hocko <mhocko@...e.cz>,
Vlastimil Babka <vbabka@...e.cz>
Subject: Re: [PATCH 14/15] mm: Drop unlikely before IS_ERR(_OR_NULL)
On Fri, 2015-07-31 at 15:04 +0530, Viresh Kumar wrote:
> On 31-07-15, 17:32, yalin wang wrote:
> >
> > > On Jul 31, 2015, at 16:56, Kirill A. Shutemov <kirill@...temov.name> wrote:
> > >
> > > On Fri, Jul 31, 2015 at 02:08:34PM +0530, Viresh Kumar wrote:
> > >> IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
> > >> is no need to do that again from its callers. Drop it.
> > >>
> > >> Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
> > >
> > > Acked-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
>
> > search in code, there are lots of using like this , does need add this check into checkpatch ?
>
> cc'd Joe for that. :)
>
> > # grep -r 'likely.*IS_ERR' .
> > ./include/linux/blk-cgroup.h: if (unlikely(IS_ERR(blkg)))
> > ./fs/nfs/objlayout/objio_osd.c: if (unlikely(IS_ERR(od))) {
> > ./fs/cifs/readdir.c: if (unlikely(IS_ERR(dentry)))
> > ./fs/ext4/extents.c: if (unlikely(IS_ERR(bh))) {
> > ./fs/ext4/extents.c: if (unlikely(IS_ERR(path1))) {
> > ./fs/ext4/extents.c: if (unlikely(IS_ERR(path2))) {
>
> Btw, my series has fixed all of them :)
If it's all fixed, then it's unlikely to be needed in checkpatch.
But given the unlikely was added when using gcc3.4, I wonder if
it's still appropriate to use unlikely in IS_ERR at all.
---
commit b5acea523151452c37cd428437e7576a291dd146
Author: Andrew Morton <akpm@...l.org>
Date: Sun Aug 22 23:04:49 2004 -0700
[PATCH] mark IS_ERR as unlikely()
It seems fair to assume that it is always unlikely that IS_ERR will return
true.
This patch changes the gcc-3.4-generated kernel text by ~500 bytes (less) so
it's fair to assume that the compiler is indeed propagating unlikeliness out
of inline functions.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists