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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 03 May 2010 12:18:00 +0300
From:	Avi Kivity <avi@...hat.com>
To:	Jiri Slaby <jslaby@...e.cz>
CC:	Changli Gao <xiaosuo@...il.com>,
	Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>,
	akpm@...ux-foundation.org, paulmck@...ux.vnet.ibm.com,
	adobriyan@...il.com, mingo@...e.hu, peterz@...radead.org,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs: use kmalloc() to allocate fdmem if possible

On 05/03/2010 12:03 PM, Jiri Slaby wrote:
>
>    
>>> Because vmalloc is used to allocate virtually contiguous memory. v in
>>> vmalloc means virtually.
>>>
>>>
>>>        
>> A kmalloc()ed page is virtually contiguous, satisfying your requirement.
>>      
> But it won't work well for vmalloc_to_{page,pfn} and similar.

Modify vmalloc_to_{page,pfn} accordingly.

> Some code
> may expect vmalloc result to be in the vmalloc area and page-aligned
> (both in position and size).
>    

Both would be a bug IMO.  vmalloc() follows kmalloc() and malloc() which 
only guarantee natural alignment.

> Not that it won't be possible to inspect the callers, but in my eyes it
> would definitely be better to introduce kmalloc_or_vmalloc-alike where
> the caller explicitly doesn't care about the resulting position and size.
>    

You're forcing every user to make a choice about what's essentially a 
micro optimization.

If it's really needed to have a vmalloc-in-vmalloc-space, that should be 
a special function, while the ordinary vmalloc should make the optimization.

-- 
error compiling committee.c: too many arguments to function

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