Skip to content

Commit cb8f488

Browse files
Denys Vlasenkotorvalds
authored andcommitted
mmap.c: deinline a few functions
__vma_link_file and expand_downwards functions are not small, yeat they are marked inline. They probably had one callsite sometime in the past, but now they have more. In order to prevent similar thing, I also deinlined expand_upwards, despite it having only pne callsite. Nowadays gcc auto-inlines such static functions anyway. In find_extend_vma, I removed one extra level of indirection. Patch is deliberately generated with -U $BIGNUM to make it easier to see that functions are big. Result: # size */*/mmap.o */vmlinux text data bss dec hex filename 9514 188 16 9718 25f6 0.org/mm/mmap.o 9237 188 16 9441 24e1 deinline/mm/mmap.o 6124402 858996 389480 7372878 70804e 0.org/vmlinux 6124113 858996 389480 7372589 707f2d deinline/vmlinux Signed-off-by: Denys Vlasenko <[email protected]> Cc: Hugh Dickins <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 51b07fc commit cb8f488

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mm/mmap.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma,
410410
rb_insert_color(&vma->vm_rb, &mm->mm_rb);
411411
}
412412

413-
static inline void __vma_link_file(struct vm_area_struct *vma)
413+
static void __vma_link_file(struct vm_area_struct *vma)
414414
{
415415
struct file * file;
416416

@@ -1591,7 +1591,7 @@ static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, un
15911591
* vma is the last one with address > vma->vm_end. Have to extend vma.
15921592
*/
15931593
#ifndef CONFIG_IA64
1594-
static inline
1594+
static
15951595
#endif
15961596
int expand_upwards(struct vm_area_struct *vma, unsigned long address)
15971597
{
@@ -1641,7 +1641,7 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address)
16411641
/*
16421642
* vma is the first one with address < vma->vm_start. Have to extend vma.
16431643
*/
1644-
static inline int expand_downwards(struct vm_area_struct *vma,
1644+
static int expand_downwards(struct vm_area_struct *vma,
16451645
unsigned long address)
16461646
{
16471647
int error;
@@ -1703,7 +1703,7 @@ find_extend_vma(struct mm_struct *mm, unsigned long addr)
17031703
vma = find_vma_prev(mm, addr, &prev);
17041704
if (vma && (vma->vm_start <= addr))
17051705
return vma;
1706-
if (!prev || expand_stack(prev, addr))
1706+
if (expand_stack(prev, addr))
17071707
return NULL;
17081708
if (prev->vm_flags & VM_LOCKED) {
17091709
if (mlock_vma_pages_range(prev, addr, prev->vm_end) < 0)

0 commit comments

Comments
 (0)