lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 17 May 2009 13:26:13 -0700
From:	Arjan van de Ven <arjan@...radead.org>
To:	tom.leiming@...il.com
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	Ming Lei <tom.leiming@...il.com>
Subject: Re: [PATCH] kernel/async.c:introduce async_schedule*_atomic

On Tue, 12 May 2009 23:13:42 +0800
tom.leiming@...il.com wrote:

> From: Ming Lei <tom.leiming@...il.com>
> 
> The async_schedule* may not be called in atomic contexts if out of
> memory or if there's too much work pending already, because the
> async function to be called may sleep.
> 
> This patch fixes the comment of async_schedule*, and introduces
> async_schedules*_atomic to allow them called from atomic contexts
> safely.

(sorry for the late response; have been away from most of my email for
a few days)

I like the general idea; I was hoping to do it a little bit different
though, API wise.
I don't mind the parameter for "don't do blocking things" (we should
use that to also use GFP_KERNEL/GFP_NOFS or whatever for the
allocation), it makes sense.

What I would like to see is the option to pass in memory that was
externally kmalloc'd. So that you can do

foo = kmalloc(..)
spin_lock(bar)
...
async_schedule_atomic(...);

spin_unlock(bar);
if (not_used_foo)
    kfree(foo);

in cases where you don't want to fail while in the atomic portion,
but can fail better earlier.



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ