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: <48D3D836.40306@linux-foundation.org>
Date:	Fri, 19 Sep 2008 11:49:58 -0500
From:	Christoph Lameter <cl@...ux-foundation.org>
To:	Eric Dumazet <dada1@...mosbay.com>
CC:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, jeremy@...p.org, ebiederm@...ssion.com,
	travis@....com, herbert@...dor.apana.org.au, xemul@...nvz.org,
	penberg@...helsinki.fi
Subject: Re: [patch 3/4] cpu alloc: The allocator

Eric Dumazet wrote:

>> +    unsigned long start;
>> +    int units = size_to_units(size);
>> +    void *ptr;
>> +    int first;
>> +    unsigned long flags;
>> +
>> +    if (!size)
>> +        return ZERO_SIZE_PTR;
>> +
>> +    WARN_ON(align > PAGE_SIZE);
> 
> if (align < UNIT_SIZE)
>     align = UNIT_SIZE;

size_to_units() does round up:


/*
 * How many units are needed for an object of a given size
 */
static int size_to_units(unsigned long size)
{
        return DIV_ROUND_UP(size, UNIT_SIZE);
}

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