[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F32A55E.8010401@linux.vnet.ibm.com>
Date: Wed, 08 Feb 2012 08:39:58 -0800
From: Dave Hansen <dave@...ux.vnet.ibm.com>
To: Seth Jennings <sjenning@...ux.vnet.ibm.com>
CC: Greg Kroah-Hartman <gregkh@...e.de>,
Nitin Gupta <ngupta@...are.org>,
Dan Magenheimer <dan.magenheimer@...cle.com>,
Brian King <brking@...ux.vnet.ibm.com>,
Konrad Wilk <konrad.wilk@...cle.com>, linux-mm@...ck.org,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/5] staging: zsmalloc: zsmalloc memory allocation library
On 02/06/2012 09:26 AM, Seth Jennings wrote:
> On 01/26/2012 01:12 PM, Dave Hansen wrote:
>> void *kmap_atomic_prot(struct page *page, pgprot_t prot)
>> {
>> ...
>> type = kmap_atomic_idx_push();
>> idx = type + KM_TYPE_NR*smp_processor_id();
>> vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
>>
>> I think if you do a get_cpu()/put_cpu() or just a preempt_disable()
>> across the operations you'll be guaranteed to get two contiguous addresses.
>
> I'm not quite following here. kmap_atomic() only does this for highmem pages.
> For normal pages (all pages for 64-bit), it doesn't do any mapping at all. It
> just returns the virtual address of the page since it is in the kernel's address
> space.
>
> For this design, the pages _must_ be mapped, even if the pages are directly
> reachable in the address space, because they must be virtually contiguous.
I guess you could use vmap() for that. It's just going to be slower
than kmap_atomic(). I'm really not sure it's worth all the trouble to
avoid order-1 allocations, though.
--
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