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]
Date:	Tue, 09 Jan 2007 06:05:37 -0800
From:	Arjan van de Ven <arjan@...radead.org>
To:	thomas@...gstengraphics.com
Cc:	davej@...hat.com, linux-kernel@...r.kernel.org, arlied@...il.com
Subject: Re: [PATCH] agpgart: Allow drm-populated agp memory types

On Tue, 2007-01-09 at 09:23 +0100, thomas@...gstengraphics.com wrote:
> +
> +void agp_vkmalloc(size_t size, unsigned long **addr, u8 *vmalloc_flag)
> +{
> +	void *tmp = NULL;
> +
> +	*vmalloc_flag = 0;
> +
> +	if (size <= 2*PAGE_SIZE) {
> +		tmp = kmalloc(size, GFP_KERNEL);
> +	}
> +	if (tmp == NULL) {
> +		tmp = vmalloc(size);
> +		*vmalloc_flag = 1;
> +	}
> +
> +	*addr = tmp;
> +}
> +EXPORT_SYMBOL(agp_vkmalloc);


if you don't do this "fallback" thing the caller can just know it is
vmalloc due to the size... (and a 2 page kmalloc isn't going to fail on
you with GFP_KERNEL; also if you really want to deal with this failure
also tell the VM you're ok with failure (__GFP_NORETRY and such)...
but unless you do, things get a lot simpler by not doing this "fall
back" thing.

-- 
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org

-
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