[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d82e647a0905121716s1b4f8979p27249cfb8250d83c@mail.gmail.com>
Date: Wed, 13 May 2009 08:16:14 +0800
From: Ming Lei <tom.leiming@...il.com>
To: Frederic Weisbecker <fweisbec@...il.com>
Cc: arjan@...radead.org, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org
Subject: Re: [PATCH] kernel/async.c:introduce async_schedule*_atomic
2009/5/13 Frederic Weisbecker <fweisbec@...il.com>:
> On Tue, May 12, 2009 at 05:44:58PM +0200, Frederic Weisbecker wrote:
> Note that async_schedule_atomic is a confusing name.
> At a first glance, it could mean that the scheduled job
> will be run atomically.
>
> I would suggest async_schedule_inatomic() so that it follows the common
> naming pattern in use in the kernel, eg:
>
> - copy_from_user_inatomic()
> - futex_atomic_cmpxchg_inatomic()
>
> and so on.
Agree, I'll fix it in next version.
>
>
>
>> > * Returns an async_cookie_t that may be used for checkpointing later.
>> > - * Note: This function may be called from atomic or non-atomic contexts.
>> > + * Note:This function may be called from non-atomic contexts,and not
>> > + * called from atomic contexts with safety. Please use
>> > + * async_schedule_atomic in atomic contexts.
>
>
> I suggest to add a comment which explains the reason for which it is unsafe
> to call it in atomic context: because the scheduled work might be synchronously
> executed.
>
> One could believe this is because async_schedule() internally uses
> a function which might sleep whereas the actual problem may come
> from the scheduled function.
Agree,add it in next version.
>
> BTW, now that we have an atomic safe version, may be we could
> also adapt the kmalloc GFP flags subsequently?
--
Lei Ming
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists