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]
Message-ID: <52A0AB34.2030703@ti.com>
Date:	Thu, 5 Dec 2013 18:35:00 +0200
From:	Grygorii Strashko <grygorii.strashko@...com>
To:	Tejun Heo <tj@...nel.org>,
	Santosh Shilimkar <santosh.shilimkar@...com>
CC:	<linux-kernel@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>, <linux-mm@...ck.org>,
	Yinghai Lu <yinghai@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2 08/23] mm/memblock: Add memblock memory allocation
 apis

Hi Tejun,

On 12/04/2013 01:24 AM, Tejun Heo wrote:
> Hello,
> 
> On Mon, Dec 02, 2013 at 09:27:23PM -0500, Santosh Shilimkar wrote:
>> So we add equivalent APIs so that we can replace usage of bootmem
>> with memblock interfaces. Architectures already converted to NO_BOOTMEM
>> use these new interfaces and other which still uses bootmem, these new
>> APIs just fallback to exiting bootmem APIs. So no functional change as
>> such.
> 
> The last part of the second last sentence doesn't parse too well.  I
> think it'd be worthwhile to improve and preferably expand on it as
> this is a bit tricky to understand given the twisted state of early
> memory allocation.
> 
>> In long run, once all the achitectures moves to NO_BOOTMEM, we can get rid of
>> bootmem layer completely. This is one step to remove the core code dependency
>> with bootmem and also gives path for architectures to move away from bootmem.
> 
> Lines too long?
> 

[...]

> 
>> +/* FIXME: Move to memblock.h at a point where we remove nobootmem.c */
>> +void *memblock_virt_alloc_try_nid_nopanic(phys_addr_t size,
>> +		phys_addr_t align, phys_addr_t from,
>> +		phys_addr_t max_addr, int nid);
> 
> Wouldn't @min_addr instead of @from make more sense?  Ditto for other
> occurrences.
> 
>> +void *memblock_virt_alloc_try_nid(phys_addr_t size, phys_addr_t align,
>> +		phys_addr_t from, phys_addr_t max_addr, int nid);
>> +void __memblock_free_early(phys_addr_t base, phys_addr_t size);
>> +void __memblock_free_late(phys_addr_t base, phys_addr_t size);
>> +
>> +#define memblock_virt_alloc(x) \
>> +	memblock_virt_alloc_try_nid(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT, \
>> +				     BOOTMEM_ALLOC_ACCESSIBLE, MAX_NUMNODES)
> 
> The underlying function interprets 0 as the default align, so it
> probably is a better idea to just use 0 here.
> 
>> +#define memblock_virt_alloc_align(x, align) \
>> +	memblock_virt_alloc_try_nid(x, align, BOOTMEM_LOW_LIMIT, \
>> +				     BOOTMEM_ALLOC_ACCESSIBLE, MAX_NUMNODES)
> 
> Also, do we really need this align variant separate when the caller
> can simply specify 0 for the default?

Unfortunately Yes. 
We need it to keep compatibility with bootmem/nobootmem
which don't handle 0 as default align value.

> 
>> +#define memblock_virt_alloc_nopanic(x) \
>> +	memblock_virt_alloc_try_nid_nopanic(x, SMP_CACHE_BYTES, \
>> +					     BOOTMEM_LOW_LIMIT, \
>> +					     BOOTMEM_ALLOC_ACCESSIBLE, \
>> +					     MAX_NUMNODES)
>> +#define memblock_virt_alloc_align_nopanic(x, align) \
>> +	memblock_virt_alloc_try_nid_nopanic(x, align, \
>> +					     BOOTMEM_LOW_LIMIT, \
>> +					     BOOTMEM_ALLOC_ACCESSIBLE, \
>> +					     MAX_NUMNODES)
>> +#define memblock_virt_alloc_node(x, nid) \
>> +	memblock_virt_alloc_try_nid(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT, \
>> +				     BOOTMEM_ALLOC_ACCESSIBLE, nid)
>> +#define memblock_virt_alloc_node_nopanic(x, nid) \

Regards,
- grygorii

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