Re: [take3 1/4] kevent: Core files.

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

 



On Thu, Aug 03, 2006 at 04:40:34PM +0200, Eric Dumazet ([email protected]) wrote:
> > +	mutex_lock(&u->ctl_mutex);
> > +	while (num < max_nr && ((k = kqueue_dequeue_ready(u)) != NULL)) {
> > +		if (copy_to_user(buf + num*sizeof(struct ukevent),
> > +					&k->event, sizeof(struct ukevent))) {
> > +			cerr = -EINVAL;
> > +			break;
> > +		}
> 
> 
> It seems quite wrong to hold ctl_mutex while doing a copy_to_user() (of 
> possibly a large amount of data) : A thread can sleep on a page fault and 
> other threads cannot make progress.

I would not call that wrong - system prevents some threads from removing 
kevents which are counted to be transfered to the userspace, i.e. when 
dequeuing was awakened and it had seen some events it is possible, that 
when it will dequeue them part will be removed by other thread, so I 
prevent this.

> Eric

-- 
	Evgeniy Polyakov
-
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