Re: What protection does sysfs_readdir have with SMP/Preemption?

From: Maneesh Soni
Date: Wed Nov 23 2005 - 07:53:04 EST

On Wed, Nov 23, 2005 at 09:18:45AM +0100, Ingo Molnar wrote:
> * Maneesh Soni <maneesh@xxxxxxxxxx> wrote:
> > But the bad pointer reference seen in sysfs_readdir() has to be
> > debugged. Assumption here is that if there is a dentry attached to
> > s_dirent, there has to be a inode associated becuase negative dentries
> > are not created in sysfs. Is it possible to get some more information
> > about the recreation scenario. Could you enable DEBUG printks for
> > lib/kobject.c and drivers/base/class.c to see the events happening.
> on a related note - i've been carrying the patch below in -rt for 2
> months (i.e. Steven's kernel has it too), as a workaround against the
> crash described below.

[ replied in the separate thread ]

> so it appears that the -rt kernel is triggering some genuine sysfs race.
> [note that it only happens on an SMP kernel, booting an UP kernel or
> with maxcpus=1 makes the bug go away.] I have done full kobject
> debugging but no conclusive results. Also, that particular crash happens
> earliest with PAGEALLOC enabled. [i have packed up the email discussion
> related to that crash, and i'm sending it to Maneesh separately.
> Maneesh, any ideas or suggestions?]

Still waiting for that mail to show up. Looks like this discussion is not
on lkml.

The kdobject or driver core debugging messages can possibly narrow the problem
down to some particular sysfs user like some driver or module and throw some
light on how the sysfs calls are being made.

> note that Steven has a dual-core Athlon64 X2 system. Steven, do you get
> the crash even with maxcpus=1?
> Ingo

Maneesh Soni
Linux Technology Center,
IBM India Software Labs,
Bangalore, India
email: maneesh@xxxxxxxxxx
Phone: 91-80-25044990
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at