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]
Message-ID: <87a9rltszn.fsf@xmission.com>
Date:	Sun, 03 Feb 2013 05:41:16 -0800
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Tejun Heo <tj@...nel.org>
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	rusty@...tcorp.com.au, bfields@...ldses.org,
	skinsbursky@...allels.com, jmorris@...ei.org, axboe@...nel.dk
Subject: Re: [PATCHSET] idr: implement idr_alloc() and convert existing users

Tejun Heo <tj@...nel.org> writes:

> Hello,

So my first response after looking at the ipc patch is ick.

Why the deep percpu magic?
Why don't associate idr_preload with an idr structure.

When reading code with idr_preload I get this deep down creepy feeling.
What is this magic that is going on?

Can't we just put the preload list_head into struct idr make
idr_preload and idr_preload_end take an idr argument?

Maybe we can have a special structure we put on the stack that has
the list_head and the preload state instead.

The way this works just weirds me out and I really really don't like it.

I would rather continue to use the existing functions as problematic as
they are as I don't need a course in deep magic to make sense of them.

> 	idr_preload(GFP_KERNEL);
> 	spin_lock(lock);
>
> 	id = idr_alloc(idr, ptr, lower_limit, upper_limit, GFP_NOWAIT);
>
> 	spin_unlock(lock);
> 	idr_preload_end();
> 	if (id < 0)
> 		return id;

Eric
--
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