+ list_lru-dont-call-list_lru_from_kmem-if-the-list_head-is-empty.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: list_lru: don't call list_lru_from_kmem if the list_head is empty
has been added to the -mm tree.  Its filename is
     list_lru-dont-call-list_lru_from_kmem-if-the-list_head-is-empty.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/list_lru-dont-call-list_lru_from_kmem-if-the-list_head-is-empty.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/list_lru-dont-call-list_lru_from_kmem-if-the-list_head-is-empty.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Jeff Layton <jlayton@xxxxxxxxxxxxxxx>
Subject: list_lru: don't call list_lru_from_kmem if the list_head is empty

If the list_head is empty then we'll have called list_lru_from_kmem for
nothing.  Move that call inside of the list_empty if block.

Signed-off-by: Jeff Layton <jeff.layton@xxxxxxxxxxxxxxx>
Reviewed-by: Vladimir Davydov <vdavydov@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/list_lru.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN mm/list_lru.c~list_lru-dont-call-list_lru_from_kmem-if-the-list_head-is-empty mm/list_lru.c
--- a/mm/list_lru.c~list_lru-dont-call-list_lru_from_kmem-if-the-list_head-is-empty
+++ a/mm/list_lru.c
@@ -99,8 +99,8 @@ bool list_lru_add(struct list_lru *lru,
 	struct list_lru_one *l;
 
 	spin_lock(&nlru->lock);
-	l = list_lru_from_kmem(nlru, item);
 	if (list_empty(item)) {
+		l = list_lru_from_kmem(nlru, item);
 		list_add_tail(item, &l->list);
 		l->nr_items++;
 		spin_unlock(&nlru->lock);
@@ -118,8 +118,8 @@ bool list_lru_del(struct list_lru *lru,
 	struct list_lru_one *l;
 
 	spin_lock(&nlru->lock);
-	l = list_lru_from_kmem(nlru, item);
 	if (!list_empty(item)) {
+		l = list_lru_from_kmem(nlru, item);
 		list_del_init(item);
 		l->nr_items--;
 		spin_unlock(&nlru->lock);
_

Patches currently in -mm which might be from jlayton@xxxxxxxxxxxxxxx are

list_lru-dont-call-list_lru_from_kmem-if-the-list_head-is-empty.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux