* [patch 1/3 v2]mm: don't inline page_mapping()
@ 2013-01-22 2:29 Shaohua Li
2013-01-22 2:34 ` Rik van Riel
2013-01-23 5:46 ` Minchan Kim
0 siblings, 2 replies; 6+ messages in thread
From: Shaohua Li @ 2013-01-22 2:29 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, hughd, riel, minchan
According to akpm, this saves 1/2k text and makes things simple of next patch.
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Shaohua Li <shli@fusionio.com>
---
include/linux/mm.h | 13 +------------
mm/util.c | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 12 deletions(-)
Index: linux/include/linux/mm.h
===================================================================
--- linux.orig/include/linux/mm.h 2013-01-21 15:43:46.978065595 +0800
+++ linux/include/linux/mm.h 2013-01-21 15:44:42.273370813 +0800
@@ -817,18 +817,7 @@ void page_address_init(void);
#define PAGE_MAPPING_KSM 2
#define PAGE_MAPPING_FLAGS (PAGE_MAPPING_ANON | PAGE_MAPPING_KSM)
-extern struct address_space swapper_space;
-static inline struct address_space *page_mapping(struct page *page)
-{
- struct address_space *mapping = page->mapping;
-
- VM_BUG_ON(PageSlab(page));
- if (unlikely(PageSwapCache(page)))
- mapping = &swapper_space;
- else if ((unsigned long)mapping & PAGE_MAPPING_ANON)
- mapping = NULL;
- return mapping;
-}
+extern struct address_space *page_mapping(struct page *page);
/* Neutral page->mapping pointer to address_space or anon_vma or other */
static inline void *page_rmapping(struct page *page)
Index: linux/mm/util.c
===================================================================
--- linux.orig/mm/util.c 2013-01-21 15:43:46.962065796 +0800
+++ linux/mm/util.c 2013-01-22 09:50:53.758830807 +0800
@@ -5,6 +5,7 @@
#include <linux/err.h>
#include <linux/sched.h>
#include <linux/security.h>
+#include <linux/swap.h>
#include <asm/uaccess.h>
#include "internal.h"
@@ -378,6 +379,21 @@ unsigned long vm_mmap(struct file *file,
}
EXPORT_SYMBOL(vm_mmap);
+struct address_space *page_mapping(struct page *page)
+{
+ struct address_space *mapping = page->mapping;
+
+ VM_BUG_ON(PageSlab(page));
+#ifdef CONFIG_SWAP
+ if (unlikely(PageSwapCache(page)))
+ mapping = &swapper_space;
+ else
+#endif
+ if ((unsigned long)mapping & PAGE_MAPPING_ANON)
+ mapping = NULL;
+ return mapping;
+}
+
/* Tracepoints definitions. */
EXPORT_TRACEPOINT_SYMBOL(kmalloc);
EXPORT_TRACEPOINT_SYMBOL(kmem_cache_alloc);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch 1/3 v2]mm: don't inline page_mapping()
2013-01-22 2:29 [patch 1/3 v2]mm: don't inline page_mapping() Shaohua Li
@ 2013-01-22 2:34 ` Rik van Riel
2013-01-23 5:46 ` Minchan Kim
1 sibling, 0 replies; 6+ messages in thread
From: Rik van Riel @ 2013-01-22 2:34 UTC (permalink / raw)
To: Shaohua Li; +Cc: linux-mm, akpm, hughd, minchan
On 01/21/2013 09:29 PM, Shaohua Li wrote:
>
> According to akpm, this saves 1/2k text and makes things simple of next patch.
>
> Suggested-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Shaohua Li <shli@fusionio.com>
Acked-by: Rik van Riel <riel@redhat.com>
--
All rights reversed
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch 1/3 v2]mm: don't inline page_mapping()
2013-01-22 2:29 [patch 1/3 v2]mm: don't inline page_mapping() Shaohua Li
2013-01-22 2:34 ` Rik van Riel
@ 2013-01-23 5:46 ` Minchan Kim
2013-01-24 1:15 ` Simon Jeons
1 sibling, 1 reply; 6+ messages in thread
From: Minchan Kim @ 2013-01-23 5:46 UTC (permalink / raw)
To: Shaohua Li; +Cc: linux-mm, akpm, hughd, riel
On Tue, Jan 22, 2013 at 10:29:19AM +0800, Shaohua Li wrote:
>
> According to akpm, this saves 1/2k text and makes things simple of next patch.
>
> Suggested-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Shaohua Li <shli@fusionio.com>
Acked-by: Minchan Kim <minchan@kernel.org>
FYI,
Feel free to add in changelog if you have evidence. :)
add/remove: 1/0 grow/shrink: 6/22 up/down: 92/-516 (-424)
function old new delta
page_mapping - 48 +48
do_task_stat 2292 2308 +16
page_remove_rmap 240 248 +8
load_elf_binary 4500 4508 +8
update_queue 532 536 +4
scsi_probe_and_add_lun 2892 2896 +4
lookup_fast 644 648 +4
vcs_read 1040 1036 -4
__ip_route_output_key 1904 1900 -4
ip_route_input_noref 2508 2500 -8
shmem_file_aio_read 784 772 -12
__isolate_lru_page 272 256 -16
shmem_replace_page 708 688 -20
mark_buffer_dirty 228 208 -20
__set_page_dirty_buffers 240 220 -20
__remove_mapping 276 256 -20
update_mmu_cache 500 476 -24
set_page_dirty_balance 92 68 -24
set_page_dirty 172 148 -24
page_evictable 88 64 -24
page_cache_pipe_buf_steal 248 224 -24
clear_page_dirty_for_io 340 316 -24
test_set_page_writeback 400 372 -28
test_clear_page_writeback 516 488 -28
invalidate_inode_page 156 128 -28
page_mkclean 432 400 -32
flush_dcache_page 360 328 -32
__set_page_dirty_nobuffers 324 280 -44
shrink_page_list 2412 2356 -56
--
Kind regards,
Minchan Kim
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch 1/3 v2]mm: don't inline page_mapping()
2013-01-23 5:46 ` Minchan Kim
@ 2013-01-24 1:15 ` Simon Jeons
2013-01-24 2:25 ` Minchan Kim
0 siblings, 1 reply; 6+ messages in thread
From: Simon Jeons @ 2013-01-24 1:15 UTC (permalink / raw)
To: Minchan Kim; +Cc: Shaohua Li, linux-mm, akpm, hughd, riel
On Wed, 2013-01-23 at 14:46 +0900, Minchan Kim wrote:
> On Tue, Jan 22, 2013 at 10:29:19AM +0800, Shaohua Li wrote:
> >
> > According to akpm, this saves 1/2k text and makes things simple of next patch.
> >
> > Suggested-by: Andrew Morton <akpm@linux-foundation.org>
> > Signed-off-by: Shaohua Li <shli@fusionio.com>
> Acked-by: Minchan Kim <minchan@kernel.org>
>
> FYI,
>
> Feel free to add in changelog if you have evidence. :)
>
Hi Minchan,
Could you tell me how can you get these test result? Which tool
or ...? :)
> add/remove: 1/0 grow/shrink: 6/22 up/down: 92/-516 (-424)
> function old new delta
> page_mapping - 48 +48
> do_task_stat 2292 2308 +16
> page_remove_rmap 240 248 +8
> load_elf_binary 4500 4508 +8
> update_queue 532 536 +4
> scsi_probe_and_add_lun 2892 2896 +4
> lookup_fast 644 648 +4
> vcs_read 1040 1036 -4
> __ip_route_output_key 1904 1900 -4
> ip_route_input_noref 2508 2500 -8
> shmem_file_aio_read 784 772 -12
> __isolate_lru_page 272 256 -16
> shmem_replace_page 708 688 -20
> mark_buffer_dirty 228 208 -20
> __set_page_dirty_buffers 240 220 -20
> __remove_mapping 276 256 -20
> update_mmu_cache 500 476 -24
> set_page_dirty_balance 92 68 -24
> set_page_dirty 172 148 -24
> page_evictable 88 64 -24
> page_cache_pipe_buf_steal 248 224 -24
> clear_page_dirty_for_io 340 316 -24
> test_set_page_writeback 400 372 -28
> test_clear_page_writeback 516 488 -28
> invalidate_inode_page 156 128 -28
> page_mkclean 432 400 -32
> flush_dcache_page 360 328 -32
> __set_page_dirty_nobuffers 324 280 -44
> shrink_page_list 2412 2356 -56
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch 1/3 v2]mm: don't inline page_mapping()
2013-01-24 1:15 ` Simon Jeons
@ 2013-01-24 2:25 ` Minchan Kim
2013-01-24 3:03 ` Simon Jeons
0 siblings, 1 reply; 6+ messages in thread
From: Minchan Kim @ 2013-01-24 2:25 UTC (permalink / raw)
To: Simon Jeons; +Cc: Shaohua Li, linux-mm, akpm, hughd, riel
On Wed, Jan 23, 2013 at 07:15:20PM -0600, Simon Jeons wrote:
> On Wed, 2013-01-23 at 14:46 +0900, Minchan Kim wrote:
> > On Tue, Jan 22, 2013 at 10:29:19AM +0800, Shaohua Li wrote:
> > >
> > > According to akpm, this saves 1/2k text and makes things simple of next patch.
> > >
> > > Suggested-by: Andrew Morton <akpm@linux-foundation.org>
> > > Signed-off-by: Shaohua Li <shli@fusionio.com>
> > Acked-by: Minchan Kim <minchan@kernel.org>
> >
> > FYI,
> >
> > Feel free to add in changelog if you have evidence. :)
> >
>
> Hi Minchan,
Hello again,
>
> Could you tell me how can you get these test result? Which tool
> or ...? :)
./script/bloat-o-meter :)
>
> > add/remove: 1/0 grow/shrink: 6/22 up/down: 92/-516 (-424)
> > function old new delta
> > page_mapping - 48 +48
> > do_task_stat 2292 2308 +16
> > page_remove_rmap 240 248 +8
> > load_elf_binary 4500 4508 +8
> > update_queue 532 536 +4
> > scsi_probe_and_add_lun 2892 2896 +4
> > lookup_fast 644 648 +4
> > vcs_read 1040 1036 -4
> > __ip_route_output_key 1904 1900 -4
> > ip_route_input_noref 2508 2500 -8
> > shmem_file_aio_read 784 772 -12
> > __isolate_lru_page 272 256 -16
> > shmem_replace_page 708 688 -20
> > mark_buffer_dirty 228 208 -20
> > __set_page_dirty_buffers 240 220 -20
> > __remove_mapping 276 256 -20
> > update_mmu_cache 500 476 -24
> > set_page_dirty_balance 92 68 -24
> > set_page_dirty 172 148 -24
> > page_evictable 88 64 -24
> > page_cache_pipe_buf_steal 248 224 -24
> > clear_page_dirty_for_io 340 316 -24
> > test_set_page_writeback 400 372 -28
> > test_clear_page_writeback 516 488 -28
> > invalidate_inode_page 156 128 -28
> > page_mkclean 432 400 -32
> > flush_dcache_page 360 328 -32
> > __set_page_dirty_nobuffers 324 280 -44
> > shrink_page_list 2412 2356 -56
> >
>
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
--
Kind regards,
Minchan Kim
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch 1/3 v2]mm: don't inline page_mapping()
2013-01-24 2:25 ` Minchan Kim
@ 2013-01-24 3:03 ` Simon Jeons
0 siblings, 0 replies; 6+ messages in thread
From: Simon Jeons @ 2013-01-24 3:03 UTC (permalink / raw)
To: Minchan Kim; +Cc: Shaohua Li, linux-mm, akpm, hughd, riel
On Thu, 2013-01-24 at 11:25 +0900, Minchan Kim wrote:
> On Wed, Jan 23, 2013 at 07:15:20PM -0600, Simon Jeons wrote:
> > On Wed, 2013-01-23 at 14:46 +0900, Minchan Kim wrote:
> > > On Tue, Jan 22, 2013 at 10:29:19AM +0800, Shaohua Li wrote:
> > > >
> > > > According to akpm, this saves 1/2k text and makes things simple of next patch.
> > > >
> > > > Suggested-by: Andrew Morton <akpm@linux-foundation.org>
> > > > Signed-off-by: Shaohua Li <shli@fusionio.com>
> > > Acked-by: Minchan Kim <minchan@kernel.org>
> > >
> > > FYI,
> > >
> > > Feel free to add in changelog if you have evidence. :)
> > >
> >
> > Hi Minchan,
>
> Hello again,
>
> >
> > Could you tell me how can you get these test result? Which tool
> > or ...? :)
>
> ./script/bloat-o-meter :)
Got it, thanks. But why don't inline can save text here?
>
> >
> > > add/remove: 1/0 grow/shrink: 6/22 up/down: 92/-516 (-424)
> > > function old new delta
> > > page_mapping - 48 +48
> > > do_task_stat 2292 2308 +16
> > > page_remove_rmap 240 248 +8
> > > load_elf_binary 4500 4508 +8
> > > update_queue 532 536 +4
> > > scsi_probe_and_add_lun 2892 2896 +4
> > > lookup_fast 644 648 +4
> > > vcs_read 1040 1036 -4
> > > __ip_route_output_key 1904 1900 -4
> > > ip_route_input_noref 2508 2500 -8
> > > shmem_file_aio_read 784 772 -12
> > > __isolate_lru_page 272 256 -16
> > > shmem_replace_page 708 688 -20
> > > mark_buffer_dirty 228 208 -20
> > > __set_page_dirty_buffers 240 220 -20
> > > __remove_mapping 276 256 -20
> > > update_mmu_cache 500 476 -24
> > > set_page_dirty_balance 92 68 -24
> > > set_page_dirty 172 148 -24
> > > page_evictable 88 64 -24
> > > page_cache_pipe_buf_steal 248 224 -24
> > > clear_page_dirty_for_io 340 316 -24
> > > test_set_page_writeback 400 372 -28
> > > test_clear_page_writeback 516 488 -28
> > > invalidate_inode_page 156 128 -28
> > > page_mkclean 432 400 -32
> > > flush_dcache_page 360 328 -32
> > > __set_page_dirty_nobuffers 324 280 -44
> > > shrink_page_list 2412 2356 -56
> > >
> >
> >
> > --
> > To unsubscribe, send a message with 'unsubscribe linux-mm' in
> > the body to majordomo@kvack.org. For more info on Linux MM,
> > see: http://www.linux-mm.org/ .
> > Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-01-24 3:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-22 2:29 [patch 1/3 v2]mm: don't inline page_mapping() Shaohua Li
2013-01-22 2:34 ` Rik van Riel
2013-01-23 5:46 ` Minchan Kim
2013-01-24 1:15 ` Simon Jeons
2013-01-24 2:25 ` Minchan Kim
2013-01-24 3:03 ` Simon Jeons
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).