linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Christoph Lameter <cl@linux.com>
Cc: Markus Trippelsdorf <markus@trippelsdorf.de>,
	Christian Kujau <lists@nerdbynature.de>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	"Alex,Shi" <alex.shi@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	Pekka Enberg <penberg@kernel.org>, Matt Mackall <mpm@selenic.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Tejun Heo <tj@kernel.org>
Subject: Re: slub: Lockout validation scans during freeing of object
Date: Tue, 22 Nov 2011 18:21:24 +0100	[thread overview]
Message-ID: <1321982484.18002.6.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> (raw)
In-Reply-To: <alpine.DEB.2.00.1111221052130.28197@router.home>

Le mardi 22 novembre 2011 A  10:53 -0600, Christoph Lameter a A(C)crit :
> A bit heavy handed locking but this should do the trick.
> 
> Subject: slub: Lockout validation scans during freeing of object
> 
> Slab validation can run right now while the slab free paths prepare
> the redzone fields etc around the objects in preparation of the
> actual freeing of the object. This can lead to false positives.
> 
> Take the node lock unconditionally during free so that the validation
> can examine objects without them being disturbed by freeing operations.
> 
> Signed-off-by: Christoph Lameter <cl@linux.com>
> 
> ---
>  mm/slub.c |   12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> Index: linux-2.6/mm/slub.c
> ===================================================================
> --- linux-2.6.orig/mm/slub.c	2011-11-22 10:42:19.000000000 -0600
> +++ linux-2.6/mm/slub.c	2011-11-22 10:44:34.000000000 -0600
> @@ -2391,8 +2391,15 @@ static void __slab_free(struct kmem_cach
> 
>  	stat(s, FREE_SLOWPATH);
> 
> -	if (kmem_cache_debug(s) && !free_debug_processing(s, page, x, addr))
> -		return;
> +	if (kmem_cache_debug(s)) {
> +
> +		/* Lock out any concurrent validate_slab calls */
> +		n = get_node(s, page_to_nid(page));
> +		spin_lock_irqsave(&n->list_lock, flags);
> +
> +		if (!free_debug_processing(s, page, x, addr))
> +			goto out;
> +	}
> 
>  	do {
>  		prior = page->freelist;
> @@ -2471,6 +2478,7 @@ static void __slab_free(struct kmem_cach
>  			stat(s, FREE_ADD_PARTIAL);
>  		}
>  	}
> +out:
>  	spin_unlock_irqrestore(&n->list_lock, flags);
>  	return;
> 


This seems better, but I still have some warnings :

[  162.117574] SLUB: selinux_inode_security 136 slabs counted but counter=137
[  179.879907] SLUB: task_xstate 1 slabs counted but counter=2
[  179.881745] SLUB: vm_area_struct 47 slabs counted but counter=48
[  180.381964] SLUB: kmalloc-64 46 slabs counted but counter=47
[  192.366437] SLUB: vm_area_struct 82 slabs counted but counter=83
[  195.016732] SLUB: names_cache 3 slabs counted but counter=4
[  196.073166] SLUB: dentry 623 slabs counted but counter=624
[  196.093857] SLUB: names_cache 3 slabs counted but counter=4
[  196.631420] SLUB: names_cache 5 slabs counted but counter=6
[  198.760180] SLUB: kmalloc-16 30 slabs counted but counter=31
[  198.773492] SLUB: names_cache 5 slabs counted but counter=6
[  198.783637] SLUB: selinux_inode_security 403 slabs counted but counter=404
[  201.717932] SLUB: filp 53 slabs counted but counter=54
[  202.984756] SLUB: filp 40 slabs counted but counter=41
[  203.819525] SLUB: task_xstate 3 slabs counted but counter=4
[  205.699916] SLUB: cfq_io_context 1 slabs counted but counter=2
[  206.526646] SLUB: skbuff_head_cache 4 slabs counted but counter=5
[  208.431951] SLUB: names_cache 3 slabs counted but counter=4
[  210.672056] SLUB: vm_area_struct 88 slabs counted but counter=89
[  213.160055] SLUB: vm_area_struct 94 slabs counted but counter=95
[  215.604856] SLUB: cfq_queue 1 slabs counted but counter=2
[  217.872494] SLUB: filp 56 slabs counted but counter=57
[  220.184599] SLUB: names_cache 3 slabs counted but counter=4
[  221.783732] SLUB: anon_vma_chain 53 slabs counted but counter=54
[  221.816662] SLUB: kmalloc-16 66 slabs counted but counter=67
[  221.828582] SLUB: names_cache 3 slabs counted but counter=4
[  221.848231] SLUB: vm_area_struct 99 slabs counted but counter=100
[  224.125411] SLUB: kmalloc-16 30 slabs counted but counter=31
[  224.126313] SLUB: kmalloc-16 67 slabs counted but counter=68
[  224.138768] SLUB: names_cache 3 slabs counted but counter=4
[  224.921409] SLUB: anon_vma 36 slabs counted but counter=37
[  224.927833] SLUB: buffer_head 294 slabs counted but counter=295
[  226.473891] SLUB: kmalloc-16 67 slabs counted but counter=68
[  228.801716] SLUB: names_cache 5 slabs counted but counter=6
[  229.610225] SLUB: filp 47 slabs counted but counter=48
[  232.050811] SLUB: filp 53 slabs counted but counter=54
[  235.835888] SLUB: names_cache 3 slabs counted but counter=4
[  236.625318] SLUB: filp 48 slabs counted but counter=49
[  236.634563] SLUB: kmalloc-16 30 slabs counted but counter=31
[  236.635667] SLUB: kmalloc-16 67 slabs counted but counter=68
[  237.500016] SLUB: radix_tree_node 100 slabs counted but counter=101
[  238.248677] SLUB: filp 48 slabs counted but counter=49
[  239.097674] SLUB: filp 49 slabs counted but counter=50
[  239.975020] SLUB: names_cache 3 slabs counted but counter=4
[  241.569766] SLUB: vm_area_struct 102 slabs counted but counter=103
[  242.388502] SLUB: names_cache 5 slabs counted but counter=6
[  243.152519] SLUB: anon_vma_chain 56 slabs counted but counter=57
[  245.661970] SLUB: filp 49 slabs counted but counter=50
[  247.298004] SLUB: filp 48 slabs counted but counter=50
[  248.851148] SLUB: journal_handle 3 slabs counted but counter=4
[  249.674320] SLUB: names_cache 3 slabs counted but counter=4
[  250.414476] SLUB: bio-0 24 slabs counted but counter=25
[  250.461655] SLUB: kmalloc-96 49 slabs counted but counter=50
[  250.477188] SLUB: sgpool-16 0 slabs counted but counter=1
[  251.298554] SLUB: kmalloc-32 9 slabs counted but counter=10
[  252.096119] SLUB: names_cache 3 slabs counted but counter=4
[  256.179892] SLUB: filp 58 slabs counted but counter=59
[  256.188385] SLUB: kmalloc-16 30 slabs counted but counter=31
[  257.040508] SLUB: kmalloc-16 30 slabs counted but counter=31
[  258.704236] SLUB: buffer_head 502 slabs counted but counter=503
[  258.745777] SLUB: kmalloc-32 9 slabs counted but counter=10
[  258.752285] SLUB: names_cache 3 slabs counted but counter=4
[  260.412312] SLUB: filp 54 slabs counted but counter=56
[  261.213526] SLUB: filp 44 slabs counted but counter=45
[  262.846810] SLUB: kmalloc-16 31 slabs counted but counter=32
[  262.859062] SLUB: names_cache 5 slabs counted but counter=6
[  262.881728] SLUB: task_xstate 3 slabs counted but counter=4
[  263.672055] SLUB: filp 54 slabs counted but counter=55
[  266.191191] SLUB: kmalloc-16 30 slabs counted but counter=31
[  266.203799] SLUB: names_cache 5 slabs counted but counter=6
[  268.486964] SLUB: filp 52 slabs counted but counter=53
[  268.509446] SLUB: names_cache 5 slabs counted but counter=6
[  269.365745] SLUB: vm_area_struct 88 slabs counted but counter=89



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-11-22 17:21 UTC|newest]

Thread overview: 109+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-18  7:25 WARNING: at mm/slub.c:3357, kernel BUG at mm/slub.c:3413 Markus Trippelsdorf
2011-11-18  7:55 ` Markus Trippelsdorf
2011-11-18  8:43   ` Alex,Shi
2011-11-18  8:54     ` Markus Trippelsdorf
2011-11-18  8:57       ` Markus Trippelsdorf
2011-11-18 12:02       ` Markus Trippelsdorf
2011-11-21  0:44         ` Alex,Shi
2011-11-21  7:29           ` Markus Trippelsdorf
2011-11-21  8:05           ` Markus Trippelsdorf
2011-11-21  8:24             ` Markus Trippelsdorf
2011-11-21  8:56               ` Eric Dumazet
2011-11-21  9:16               ` Eric Dumazet
2011-11-21 13:15                 ` Markus Trippelsdorf
2011-11-21 14:16                   ` Eric Dumazet
2011-11-21 14:21                     ` Markus Trippelsdorf
2011-11-21 15:36                     ` Markus Trippelsdorf
2011-11-21 15:48                       ` Eric Dumazet
2011-11-21 16:10                         ` Markus Trippelsdorf
2011-11-21 16:34                           ` Markus Trippelsdorf
2011-11-22  8:36                             ` Markus Trippelsdorf
2011-12-19  3:21                               ` Eric W. Biederman
2011-12-19  9:19                                 ` Markus Trippelsdorf
2011-12-19  9:06                                   ` Eric W. Biederman
2011-11-21 16:52                           ` Eric Dumazet
2011-11-21 17:15                             ` Eric Dumazet
2011-11-21 17:35                               ` Markus Trippelsdorf
2011-11-21 18:39                                 ` Eric Dumazet
2011-11-21 18:52                                   ` Markus Trippelsdorf
2011-11-21 19:51                                     ` Markus Trippelsdorf
2011-11-21 20:27                                       ` Benjamin Herrenschmidt
2011-11-21 21:30                                         ` Pekka Enberg
2011-11-21 21:43                                           ` Christoph Lameter
2011-11-22  0:21                                         ` Christian Kujau
2011-11-22  0:42                                           ` Christian Kujau
2011-11-22  2:17                                           ` Benjamin Herrenschmidt
2011-11-22  8:37                                             ` Christian Kujau
2011-11-22  3:18                                           ` Christoph Lameter
2011-11-22  7:48                                             ` Eric Dumazet
2011-11-22  7:51                                               ` Markus Trippelsdorf
2011-11-22  8:27                                               ` Eric Dumazet
2011-11-23  7:13                                                 ` Markus Trippelsdorf
2011-11-23  7:20                                                   ` Eric Dumazet
2011-11-22  8:39                                               ` Christian Kujau
2011-11-22 22:16                                                 ` Benjamin Herrenschmidt
2011-11-22 22:31                                                   ` Eric Dumazet
2011-11-22 22:32                                                   ` Christoph Lameter
2011-11-22 21:58                                               ` Benjamin Herrenschmidt
2011-11-22 23:12                                                 ` Christian Kujau
2011-11-23  0:18                                                   ` Benjamin Herrenschmidt
2011-11-23  1:22                                                     ` Christian Kujau
2011-11-23  1:43                                                       ` Benjamin Herrenschmidt
2011-11-23  5:51                                                     ` Christian Kujau
2011-11-23  6:59                                                       ` Pekka Enberg
2011-11-23 15:14                                                         ` slub: use irqsafe_cpu_cmpxchg for put_cpu_partial Christoph Lameter
2011-11-23 16:04                                                           ` Eric Dumazet
2011-11-23 18:33                                                           ` Christian Kujau
2011-11-24  6:45                                                             ` Pekka Enberg
2011-11-23 23:15                                                           ` David Rientjes
2011-11-22  8:45                                             ` WARNING: at mm/slub.c:3357, kernel BUG at mm/slub.c:3413 Markus Trippelsdorf
2011-11-22  9:25                                               ` Eric Dumazet
2011-11-22  9:27                                                 ` Eric Dumazet
2011-11-22  9:38                                               ` Eric Dumazet
2011-11-22  9:46                                                 ` Eric Dumazet
2011-11-22 14:46                                                   ` Christoph Lameter
2011-11-22 14:52                                                     ` Eric Dumazet
2011-11-22 15:02                                                       ` Christoph Lameter
2011-11-22 15:07                                                         ` Christoph Lameter
2011-11-22 16:20                                                           ` Christoph Lameter
2011-11-22 16:32                                                             ` Eric Dumazet
2011-11-22 16:36                                                               ` Christoph Lameter
2011-11-22 16:41                                                                 ` Christoph Lameter
2011-11-22 16:53                                                                   ` slub: Lockout validation scans during freeing of object Christoph Lameter
2011-11-22 17:21                                                                     ` Eric Dumazet [this message]
2011-11-22 17:40                                                                       ` Christoph Lameter
2011-11-22 18:55                                                                         ` Markus Trippelsdorf
2011-11-22 19:20                                                                           ` Christoph Lameter
2011-11-22 19:32                                                                             ` Markus Trippelsdorf
2011-11-22 19:46                                                                               ` Christoph Lameter
2011-11-22 17:59                                                                       ` Christoph Lameter
2011-11-22 11:21                                                 ` WARNING: at mm/slub.c:3357, kernel BUG at mm/slub.c:3413 Markus Trippelsdorf
2011-11-22 14:50                                                   ` Christoph Lameter
2011-11-22 14:44                                                 ` Christoph Lameter
2011-11-21 15:51                       ` Markus Trippelsdorf
2011-11-23 16:03                       ` Markus Trippelsdorf
2011-11-23 16:06                         ` Christoph Lameter
2011-11-24  8:50                           ` Markus Trippelsdorf
2011-12-01  8:44                             ` Markus Trippelsdorf
2011-12-01  8:53                               ` Pekka Enberg
2011-12-02 19:43                               ` Jerome Glisse
2011-12-02 20:06                                 ` Markus Trippelsdorf
2011-12-02 20:48                                   ` Markus Trippelsdorf
2011-12-07 14:32                                     ` Robert Richter
2011-12-07 14:39                                       ` Markus Trippelsdorf
2011-12-02 23:04                             ` Jerome Glisse
2011-12-03  9:28                               ` Markus Trippelsdorf
2011-12-03 12:20                                 ` Dave Airlie
2011-12-03 12:29                                   ` Markus Trippelsdorf
2011-12-03 19:31                                     ` Jerome Glisse
2011-12-03 19:32                                       ` Jerome Glisse
2011-12-04  1:02                                       ` Markus Trippelsdorf
2011-12-04 17:32                                         ` Jerome Glisse
2011-12-05 17:10                                         ` Jerome Glisse
2011-12-05 18:15                                           ` Markus Trippelsdorf
2011-12-05 18:43                                             ` Jerome Glisse
2011-12-05 19:11                                             ` Jerome Glisse
2011-12-05 19:27                                               ` Markus Trippelsdorf
2011-12-05 20:10                                                 ` Pekka Enberg
2011-12-05 20:20                                                   ` Jerome Glisse
2011-12-05 10:44                                     ` David Laight

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1321982484.18002.6.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC \
    --to=eric.dumazet@gmail.com \
    --cc=alex.shi@intel.com \
    --cc=benh@kernel.crashing.org \
    --cc=cl@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lists@nerdbynature.de \
    --cc=markus@trippelsdorf.de \
    --cc=mpm@selenic.com \
    --cc=netdev@vger.kernel.org \
    --cc=penberg@kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox