[lkml]   [2003]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: How can I force a read to hit the disk?
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
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:48    [from the cache]
©2003-2011 Jasper Spaans