login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
December
»
10
Re: [RFC][PATCH 02/10] mm: Remove likely() from mapping_unevictable()
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: KOSAKI Motohiro
Subject:
Re: [RFC][PATCH 02/10] mm: Remove likely() from mapping_unevictable()
Date: Friday, December 10, 2010 - 12:00 am
> [ Resending to Nick's real email ]
quoted text
> > > From: Steven Rostedt <srostedt@redhat.com> > > The mapping_unevictable() has a likely() around the mapping parameter. > This mapping parameter comes from page_mapping() which has an > unlikely() that the page will be set as PAGE_MAPPING_ANON, and if > so, it will return NULL. One would think that this unlikely() means > that the mapping returned by page_mapping() would not be NULL, but > where page_mapping() is used just above mapping_unevictable(), that > unlikely() is incorrect most of the time. This means that the > "likely(mapping)" in mapping_unevictable() is incorrect most of the > time. > > Running the annotated branch profiler on my main box which runs firefox, > evolution, xchat and is part of my distcc farm, I had this: > > correct incorrect % Function File Line > ------- --------- - -------- ---- ---- > 12872836 1269443893 98 mapping_unevictable pagemap.h 51 > 35935762 1270265395 97 page_mapping mm.h 659 > 1306198001 143659 0 page_mapping mm.h 657 > 203131478 121586 0 page_mapping mm.h 657 > 5415491 1116 0 page_mapping mm.h 657 > 74899487 1116 0 page_mapping mm.h 657 > 203132845 224 0 page_mapping mm.h 659 > 5415464 27 0 page_mapping mm.h 659 > 13552 0 0 page_mapping mm.h 657 > 13552 0 0 page_mapping mm.h 659 > 242630 0 0 page_mapping mm.h 657 > 242630 0 0 page_mapping mm.h 659 > 74899487 0 0 page_mapping mm.h 659 > > The page_mapping() is a static inline, which is why it shows up multiple > times. The mapping_unevictable() is also a static inline but seems to > be used only once in my setup. > > The unlikely in page_mapping() was correct a total of 1909540379 times and > incorrect 1270533123 times, with a 39% being incorrect. Perhaps this is > enough to remove the unlikely from page_mapping() as well. > > Cc: Andrew Morton <akpm@linux-foundation.org> > Cc: Nick Piggin <nickpiggin@yahoo.com.au> > Cc: Rik van Riel <riel@redhat.com> > Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com> > Signed-off-by: Steven Rostedt <rostedt@goodmis.org> > --- > include/linux/pagemap.h | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h > index 2d1ffe3..9c66e99 100644 > --- a/include/linux/pagemap.h > +++ b/include/linux/pagemap.h > @@ -48,7 +48,7 @@ static inline void mapping_clear_unevictable(struct address_space *mapping) > > static inline int mapping_unevictable(struct address_space *mapping) > { > - if (likely(mapping)) > + if (mapping) > return test_bit(AS_UNEVICTABLE, &mapping->flags); > return !!mapping; > }
I think you are right. Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> --
unsubscribe notice
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/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[RFC][PATCH 00/10] incorrect unlikely() and likely() cleanups
, Steven Rostedt
, (Mon Dec 6, 6:58 pm)
[RFC][PATCH 01/10] sched: Change rt_task(prev) in pre_sche ...
, Steven Rostedt
, (Mon Dec 6, 6:58 pm)
[RFC][PATCH 02/10] mm: Remove likely() from mapping_unevic ...
, Steven Rostedt
, (Mon Dec 6, 6:58 pm)
[RFC][PATCH 03/10] workqueue: It is likely that WORKER_NOT ...
, Steven Rostedt
, (Mon Dec 6, 6:58 pm)
[RFC][PATCH 04/10] sched: Change pick_next_task_rt from un ...
, Steven Rostedt
, (Mon Dec 6, 6:58 pm)
[RFC][PATCH 05/10] mm: Remove likely() from grab_cache_pag ...
, Steven Rostedt
, (Mon Dec 6, 6:58 pm)
[RFC][PATCH 07/10] x86: Remove unlikey()s from sched_switc ...
, Steven Rostedt
, (Mon Dec 6, 6:58 pm)
[RFC][PATCH 08/10] fs: Remove unlikely() from fput_light()
, Steven Rostedt
, (Mon Dec 6, 6:58 pm)
[RFC][PATCH 09/10] fs: Remove unlikely() from fget_light()
, Steven Rostedt
, (Mon Dec 6, 6:58 pm)
[RFC][PATCH 10/10] sched: Remove unlikely() from ttwu_post ...
, Steven Rostedt
, (Mon Dec 6, 6:58 pm)
Re: [RFC][PATCH 02/10] mm: Remove likely() from mapping_un ...
, Steven Rostedt
, (Mon Dec 6, 7:22 pm)
Re: [RFC][PATCH 05/10] mm: Remove likely() from grab_cache ...
, Steven Rostedt
, (Mon Dec 6, 7:24 pm)
Re: [RFC][PATCH 04/10] sched: Change pick_next_task_rt fro ...
, Gregory Haskins
, (Mon Dec 6, 7:46 pm)
Re: [RFC][PATCH 04/10] sched: Change pick_next_task_rt fro ...
, Steven Rostedt
, (Mon Dec 6, 7:59 pm)
Re: [RFC][PATCH 01/10] sched: Change rt_task(prev) in pre_ ...
, Yong Zhang
, (Mon Dec 6, 8:25 pm)
Re: [RFC][PATCH 01/10] sched: Change rt_task(prev) in pre_ ...
, Steven Rostedt
, (Mon Dec 6, 8:32 pm)
Re: [RFC][PATCH 05/10] mm: Remove likely() from grab_cach ...
, Nick Piggin
, (Mon Dec 6, 11:56 pm)
Re: [RFC][PATCH 02/10] mm: Remove likely() from mapping_u ...
, Nick Piggin
, (Tue Dec 7, 12:02 am)
Re: [RFC][PATCH 03/10] workqueue: It is likely that WORKER ...
, Tejun Heo
, (Tue Dec 7, 2:49 am)
Re: [RFC][PATCH 02/10] mm: Remove likely() from mapping_un ...
, Steven Rostedt
, (Tue Dec 7, 6:06 am)
Re: [RFC][PATCH 03/10] workqueue: It is likely that WORKER ...
, Steven Rostedt
, (Tue Dec 7, 6:07 am)
Re: [RFC][PATCH 02/10] mm: Remove likely() from mapping_un ...
, Rik van Riel
, (Tue Dec 7, 9:26 am)
Re: [RFC][PATCH 02/10] mm: Remove likely() from mapping_un ...
, KOSAKI Motohiro
, (Fri Dec 10, 12:00 am)
Re: [RFC][PATCH 02/10] mm: Remove likely() from mapping_un ...
, Joe Perches
, (Fri Dec 10, 12:06 am)
Re: [RFC][PATCH 02/10] mm: Remove likely() from mapping_un ...
, Miles Bader
, (Fri Dec 10, 1:08 am)
Re: [RFC][PATCH 04/10] sched: Change pick_next_task_rt fro ...
, Steven Rostedt
, (Fri Dec 10, 5:07 pm)
Re: [RFC][PATCH 03/10] workqueue: It is likely that WORKER ...
, Steven Rostedt
, (Fri Dec 10, 5:08 pm)
Re: [RFC][PATCH 02/10] mm: Remove likely() from mapping_un ...
, Steven Rostedt
, (Fri Dec 10, 5:09 pm)
Re: [RFC][PATCH 03/10] workqueue: It is likely that WORKER ...
, Tejun Heo
, (Fri Dec 10, 5:09 pm)
Re: [RFC][PATCH 03/10] workqueue: It is likely that WORKER ...
, Steven Rostedt
, (Fri Dec 10, 5:12 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Dave Jones
Re: OT: character encodings (was: Linux 2.6.20-rc4)
Greg Kroah-Hartman
[PATCH 17/36] sysdev: detect multiple driver registrations
Sam Ravnborg
Re: [PATCH] kbuild: fix make V=1
Nick Piggin
Re: [PATCH 0/24] make atomic_read() behave consistently across all architectures
Greg Kroah-Hartman
[PATCH 10/36] driver core: Convert debug functions declared inline __attribute__((...
git
:
Stephen R. van den Berg
Re: [RFC] origin link for cherry-pick and revert
Junio C Hamano
Re: [PATCH 1/2] Teach git-describe to display distances from tags.
Johannes Schindelin
Re: [PATCH 2/2] git-svn: support fetch with autocrlf on
Junio C Hamano
Re: [PATCH 6/6] Teach core object handling functions about gitlinks
James Henstridge
Re: VCS comparison table
linux-netdev
:
Jarek Poplawski
Re: [PATCH] flush_work_sync vs. flush_scheduled_work Re: [PATCH] PHYLIB: IRQ event...
Lennert Buytenhek
Re: Distributed Switch Architecture(DSA)
Daniel Schaffrath
Re: tcp bw in 2.6
Matt Mackall
Re: [regression] nf_iterate(), BUG: unable to handle kernel NULL pointer dereference
Guo-Fu Tseng
Re: jme: UDP checksum error, and lots of them
openbsd-misc
:
Claudio Jeker
Re: Vlan Tag on Vlan Tag (l2tunneling)
Josh Grosse
ssh/sshd challenge-response seems to have stopped working in -current
Pieter Verberne
File collision while using pkg_add
Tomas Bodzar
bsd: uvm_mapent_alloc: out of static map entries
Community First Financial
Teacher A+ Loan
git-commits-head
:
Linux Kernel Mailing List
ath9k: Added get_survey callback in order to get channel noise
Linux Kernel Mailing List
tracing: protect reader of cmdline output
Linux Kernel Mailing List
kconfig: recalc symbol value before showing search results
Linux Kernel Mailing List
swsusp: provide users with a hint about the no_console_suspend option
Linux Kernel Mailing List
[ARM] 5185/1: Fix spi num_chipselect for lubbock
Colocation donated by:
Syndicate