Re: How can I force a read to hit the disk?

From: Alan Stern
Date: Tue Sep 09 2003 - 08:57:45 EST


On Tue, 9 Sep 2003, Richard B. Johnson wrote:

> On Mon, 8 Sep 2003, Alan Stern wrote:
>
> > > When your thread code starts up, execute
> > > init_rwsem(&current->mm->mmap_sem);
> > >
> > > ... This is in the thread's code, not the module init code.
> >
> > That doesn't work either; it also causes a segmentation violation. As I
> > said before, current->mm is NULL. It gets set that way by exit_mm() which
> > is called from daemonize().
> >
> > Alan Stern
> >
>
> Gawd. I assumed you knew how to initialize a pointer. I just
> located the procedure used to initialize the semaphore.

Shucks, I know how to initialize a pointer. I even know how to initialize
a read-write semaphore. The problem here is not _doing_ the
initialization; it's what _value_ to use. Kernel threads don't have a
userpace memory component, so naturally current->mm is NULL -- there's no
memory map for it to point to. Without having a memory map, of course
there's no semaphore to initialize, since the semaphore is _part_ of the
memory map structure.

Alan Stern

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