lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADqbE97Vj0UV-2XvpkoELwdey_Xw7iCsF1AhQNFjwxY583SUwg@mail.gmail.com>
Date:	Fri, 26 Aug 2011 13:13:19 +0800
From:	Zhao Jin <cronozhj@...il.com>
To:	cl@...ux-foundation.org, penberg@...nel.org, mpm@...enic.com,
	trivial@...nel.org
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] slab: avoid unnecessary touching of a partial slab

In cache_alloc_refill(), after refilling from a partial slab, if the
slab remains partial, it would be deleted from and then added again to
the partial list. As the slab is the first element in the list before
deletion, such behavior has no effect. This patch avoids touching the
slab in this case.

Signed-off-by: Zhao Jin <cronozhj@...il.com>
---
 mm/slab.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 6d90a09..3469c6f 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3121,11 +3121,14 @@ retry:
 		check_slabp(cachep, slabp);

 		/* move slabp to correct slabp list: */
-		list_del(&slabp->list);
-		if (slabp->free == BUFCTL_END)
+		if (slabp->free == BUFCTL_END) {
+			list_del(&slabp->list);
 			list_add(&slabp->list, &l3->slabs_full);
-		else
+		}
+		else if (&slabp->list != l3->slabs_partial.next) {
+			list_del(&slabp->list);
 			list_add(&slabp->list, &l3->slabs_partial);
+		}
 	}

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ