lkml.org 
[lkml]   [2015]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 01/37] uprobes: dont pass around current->mm
From
Date

From: Dave Hansen <dave.hansen@linux.intel.com>

It doesn't make a whole lot of sense to pass around 'mm' when
there is only one call path and that path passes current->mm in
all sitautions.

Remove 'mm' from one such path in uprobes.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---

b/kernel/events/uprobes.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN kernel/events/uprobes.c~uprobes-dont-pass-around-current-mm kernel/events/uprobes.c
--- a/kernel/events/uprobes.c~uprobes-dont-pass-around-current-mm 2015-11-16 12:35:34.870150592 -0800
+++ b/kernel/events/uprobes.c 2015-11-16 12:35:34.874150773 -0800
@@ -1685,7 +1685,7 @@ static void mmf_recalc_uprobes(struct mm
clear_bit(MMF_HAS_UPROBES, &mm->flags);
}

-static int is_trap_at_addr(struct mm_struct *mm, unsigned long vaddr)
+static int is_trap_at_addr(unsigned long vaddr)
{
struct page *page;
uprobe_opcode_t opcode;
@@ -1699,7 +1699,7 @@ static int is_trap_at_addr(struct mm_str
if (likely(result == 0))
goto out;

- result = get_user_pages(NULL, mm, vaddr, 1, 0, 1, &page, NULL);
+ result = get_user_pages(NULL, current->mm, vaddr, 1, 0, 1, &page, NULL);
if (result < 0)
return result;

@@ -1727,7 +1727,7 @@ static struct uprobe *find_active_uprobe
}

if (!uprobe)
- *is_swbp = is_trap_at_addr(mm, bp_vaddr);
+ *is_swbp = is_trap_at_addr(bp_vaddr);
} else {
*is_swbp = -EFAULT;
}
_

\
 
 \ /
  Last update: 2015-11-17 04:41    [W:0.182 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site