Skip to contentSkip to conversation

v2.4.19-rmk4 slab.c: /proc/slabinfo uses broken instead of slab labels

DISCUSSION Georg Nikodym 1 participant 2 messages Nov 27, 2002

lore
Share & tools
lore
#0 lore raw

In the 2.4.18-2.4.19 timeframe:

	http://linux.bkbits.net:8080/linux-2.4/[email protected]

brcl (Ben LaHaise, I think) pushed in a change to mm/slab.c which (amongst other things) adds the following code:

...

	name = cachep->name; 

===> {
===> char tmp;
===> if (__get_user(tmp, name))
===> name = "broken";
===> }

	seq_printf(m, "%-17s %6lu %6lu %6u %4lu %4lu %4u",
		name, active_objs, num_objs, cachep->objsize,
		active_slabs, num_slabs, (1<<cachep->gfporder));

...

to s_show() (the stuff that gets called when somebody cat's /proc/slabinfo)

Trouble is that on my ARM platform, the __get_user() call always fails and all the slabinfo entries are labelled "broken".

For my purposes, ifdef'ing the offending block out will likely be sufficient (and safe?) but I'd like to know:

1. Is the ARM __get_user() broken?
2. Could I be doing something else broken that is confusing __get_user()?
3. What was/is the intent of the test? Or stated differently, why on earth would cachep->name be a user address?

-g

#1 lore raw
Quoted 4 lines · On Wed, 27 Nov 2002 15:15:17 -0500 Georg Nikodym <[email protected]>…

1. Is the ARM __get_user() broken?
2. Could I be doing something else broken that is confusing __get_user()?
3. What was/is the intent of the test? Or stated differently, why on earth would cachep->name be a user address?

In answer to my own question, reading the 2.5 source was illuminating. The intent of the test is obvious:

akpm     1.50         | 	/*
akpm     1.50         | 	 * Check to see if `name' resides inside a module which has been
akpm     1.50         | 	 * unloaded (someone forgot to destroy their cache)
akpm     1.50         | 	 */

Thanks to Mr. Morton for that comment. Now I get to wrestle with questions 1 and 2.

-g