[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting behavior for clustered IO

From: Richard Braun
Subject: Re: Setting behavior for clustered IO
Date: Mon, 2 Apr 2012 17:35:43 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Mon, Apr 02, 2012 at 12:23:03AM +0300, Maksym Planeta wrote:
> The project I suppose to work on is not new for GSoC. Two years ago a
> student, whose nick on irc channel is kam, tried to implement readahead,
> but didn't manage to do that for some reason. I looked through patch he
> has sent and there he appended function vm_behavior_set for setting
> behavior of page fault handler. As parameter, this function  accepts
> constant, that specifies behavior in way that is similar to the way is
> implemented in madvise.

This function would better be named vm_advise() (think of vm_map and
vm_protect, which are named mmap and mprotect on BSD/POSIX systems).

> But I think, that if difference between behavior lies only in size of
> chunk to be read it will be more flexible to accept as parameter of
> vm_behavior_set not constant, that represents behavior, but size of
> chunk. And madvise implementation in library will convert behavior name
> to size of chunk (and for sure do other work). This will allow do more
> work in user space and add to kernel less modifications.

I don't think it's the right way to achieve that. Fault handling
parameters should be handled by the same code. If it is extracted from
the kernel some day, then several alternative implementations could use
different policies for readahead. But putting such decisions in the
kernel or libc makes little difference in practice. Also, don't forget
that it's not simply forward readahead : most implementations also read
pages preceding the fault target. Our vm_advise() should follow the
existing POSIX interface, taking into account any Mach-specific detail.

> Also kam takes into account the direction of reading for sequential
> behavior, but I doubt if this really needed, because it seems to be
> unusual way of reading. Additionally madvise doesn't have appropriate
> parameters which could be used to inform kernel about direction of
> reading.
> Am I right or is it better to do like kam was doing?

I don't think it's needed, no. Again, make it easy to implement the
POSIX call. That's plenty for a first attempt.

Richard Braun

reply via email to

[Prev in Thread] Current Thread [Next in Thread]