Re: sleeping and waiting and tasklets



In fact, early implementation of copy_from_user() verify user-space
pointer. After 2.4 kernel, to speed up running, copy_from_user()
doesn't verify user space-pointer again. Surely in copy_from_user(),
the macro "access_ok()" is called, but copy_from_user() doesn't check
whether user-space poiner is correctly mapped.

If copy_from_usr() meets a invalid pointer during copy, page fault
will happen. In kernel, there is a segment "__start__ex__table"
records "fix up" address for thoses instructions may result in page
fault. If page fault happened in copy_from_user(), do_page_fault()
will seach that segment and try to fix up the invalid address, and
then copy_from_user() returns safely but copy will be aborted.

Thus, copy_from_user() does not lead to current process going to
sleep, but copy can't be completed too. As a system program, extra
checking of user-space pointer are expected.

--Peter Z

bill.at.@xxxxxxxxxxxxxxxxxxxxxxxxxx wrote:
> I have a question about the running context of threads and tasklets.
>
> I have code that processes a packet of data. This code is called from a
> tasklet (called by the ISR) and also from a timer routine.
> This processing code can only do its job if there is space to output the
> processed data. If both data buffers are full ( a very rare but not
> impossible situation), then a timer is set and this code is then called from
> the timer callback function.
>
> My question is:
>
> 1) What is different about the running context of the tasklet vs the timer
> callback.
> 2) Can functions like interruptible_sleep_on() wake_up_interruptible() and
> down_interruptible() be used in either context?
> 3) Are there any special considerations that I should know about.
>
> I am trying to avoid mysteries in advance (of course).
>
> Thanks!
> Bill
>
> --
> Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
> ------->>>>>>http://www.NewsDemon.com<<<<<<------
> Unlimited Access, Anonymous Accounts, Uncensored Broadband Access

.



Relevant Pages