Re: [patch 05/11] syslets: core code

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

 




On Thu, 15 Feb 2007, Linus Torvalds wrote:
> 
> So I think that a good implementation just does everything up-front, and 
> doesn't _need_ a user buffer that is live over longer periods, except for 
> the actual results. Exactly because the whole alloc/teardown is nasty.

Btw, this doesn't necessarily mean "not supporting multiple atoms at all".

I think the batching of async things is potentially a great idea. I think 
it's quite workable for "open+fstat" kind of things, and I agree that it 
can solve other things too (the "socket+bind+connect+sendmsg+rcv" kind of 
complex setup things).

But I suspect that if we just said:
 - we limit these atom sequences to just linear sequences of max "n" ops
 - we read them all in in a single go at startup

we actually avoid several nasty issues. Not just the memory allocation 
issue in user space (now it's perfectly ok to build up a sequence of ops 
in temporary memory and throw it away once it's been submitted), but also 
issues like the 32-bit vs 64-bit compatibility stuff (the compat handlers 
would just convert it when they do the initial copying, and then the 
actual run-time wouldn't care about user-level pointers having different 
sizes etc).

Would it make the interface less cool? Yeah. Would it limit it to just a 
few linked system calls (to avoid memory allocation issues in the kernel)? 
Yes again. But it would simplify a lot of the interface issues.

It would _also_ allow the "sys_aio_read()" function to build up its 
*own* set of atoms in kernel space to actually do the read, and there 
would be no impact of the actual run-time wanting to read stuff from user 
space. Again - it's actually the same issue as with the compat system 
call: by making the interfaces do things up-front rather than dynamically, 
it becomes more static, but also easier to do interface translations. You 
can translate into any arbitrary internal format _once_, and be done with 
it.

I dunno. 

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux