Skip to contentSkip to conversation

mmap.c: find_vma: eliminate initial if(mm) check

PATCH In review k80c 3 participants 3 messages Apr 7, 2013

Subsystems (2)
lore
Share & tools
lore

k80c

author
#0 lore raw

PATCH 1/1 mmap.c: find_vma: eliminate initial if(mm) check

As per commit 841e31e5cc6219d62054788faa289b6ed682d068, we dont really need this if(mm) check anymore.

A WARN_ON_ONCE was added just for safety, but there have been no bug reports about this so far.

Removing this if(mm) check.

---
 mm/mmap.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
mm/mmap.c +0 -3
index 0db0de1..b2c363f 100644
@@ -1935,9 +1935,6 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
 {
 	struct vm_area_struct *vma = NULL;
 
-	if (WARN_ON_ONCE(!mm))		/* Remove this in linux-3.6 */
-		return NULL;
-
 	/* Check the cache first. */
 	/* (Cache hit rate is typically around 35%.) */
 	vma = ACCESS_ONCE(mm->mmap_cache);
Signature · 7 lines
1.7.5.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · On Sun, Apr 7, 2013 at 2:18 AM, k80c <[email protected]> wrote:

As per commit 841e31e5cc6219d62054788faa289b6ed682d068, we dont really need this if(mm) check anymore.

A WARN_ON_ONCE was added just for safety, but there have been no bug reports about this so far.

Removing this if(mm) check.

---
 mm/mmap.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
mm/mmap.c +0 -0
index 0db0de1..b2c363f 100644

mm/mmap.c struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) · line 1940

Quoted 9 lines
mm/mmap.c +0 -3
@@ -1935,9 +1935,6 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
 {
        struct vm_area_struct *vma = NULL;
 
-       if (WARN_ON_ONCE(!mm))          /* Remove this in linux-3.6 */
-               return NULL;
-
        /* Check the cache first. */
        /* (Cache hit rate is typically around 35%.) */
        vma = ACCESS_ONCE(mm->mmap_cache);

Looks good to me.

Signature · 8 lines
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#2 lore raw
In reply to k80c

I've sent the same patch and has been merged into -mm tree by Andrew Morton.

Thanks
Zhang

2013/4/7 k80c <[email protected]>

Quoted 37 lines

As per commit 841e31e5cc6219d62054788faa289b6ed682d068, we dont really need this if(mm) check anymore.

A WARN_ON_ONCE was added just for safety, but there have been no bug reports about this so far.

Removing this if(mm) check.

---
 mm/mmap.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
mm/mmap.c +0 -3
index 0db0de1..b2c363f 100644
@@ -1935,9 +1935,6 @@ struct vm_area_struct *find_vma(struct mm_struct
 *mm, unsigned long addr)
 {
        struct vm_area_struct *vma = NULL;
 
-       if (WARN_ON_ONCE(!mm))          /* Remove this in linux-3.6 */
-               return NULL;
-
        /* Check the cache first. */
        /* (Cache hit rate is typically around 35%.) */
        vma = ACCESS_ONCE(mm->mmap_cache);

--
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/