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-next>] [day] [month] [year] [list]
Date:	Tue, 4 Nov 2014 13:03:22 -0800
From:	Gregory Fong <gregory.0xf0@...il.com>
To:	linux-mm@...ck.org
Cc:	lauraa@...eaurora.org, iamjoonsoo.kim@....com, mina86@...a86.com,
	Marek Szyprowski <m.szyprowski@...sung.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Florian Fainelli <f.fainelli@...il.com>,
	Brian Norris <computersforpeace@...il.com>
Subject: CMA alignment question

Hi all,

The alignment in cma_alloc() is done w.r.t. the bitmap.  This is a
problem when, for example:

- a device requires 16M (order 12) alignment
- the CMA region is not 16 M aligned

In such a case, can result with the CMA region starting at, say,
0x2f800000 but any allocation you make from there will be aligned from
there.  Requesting an allocation of 32 M with 16 M alignment, will
result in an allocation from 0x2f800000 to 0x31800000, which doesn't
work very well if your strange device requires 16M alignment.

This doesn't have the behavior I would expect, which would be for the
allocation to be aligned w.r.t. the start of memory.  I realize that
aligning the CMA region is an option, but don't see why cma_alloc()
aligns to the start of the CMA region.  Is there a good reason for
having cma_alloc() alignment work this way?

Thanks and regards,
Gregory
--
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