From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Andrew Morton <akpm@linux-foundation.org>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
balbir@linux.vnet.ibm.com, Arjan van de Ven <arjan@infradead.org>,
Dave Airlie <airlied@gmail.com>,
David Miller <davem@davemloft.net>,
menage@google.com, jens.axboe@oracle.com, jack@suse.cz,
jes@sgi.com, linux-kernel@vger.kernel.org, dada1@cosmosbay.com,
Alexey Dobriyan <adobriyan@gmail.com>
Subject: Re: [PATCH 1/7] mm: introduce simple_malloc()/simple_free()
Date: Tue, 18 Nov 2008 13:16:44 +0800 [thread overview]
Message-ID: <49224FBC.2000702@cn.fujitsu.com> (raw)
In-Reply-To: <200811181540.00011.nickpiggin@yahoo.com.au>
Nick Piggin wrote:
> On Monday 17 November 2008 18:13, Andrew Morton wrote:
>> On Mon, 17 Nov 2008 15:43:59 +0900 "KOSAKI Motohiro"
> <kosaki.motohiro@jp.fujitsu.com> wrote:
>>>>>> (I'll rename simple_malloc/simple_free to kvmalloc/kvfree)
>>>>> I would prefer to find a way to say that one cannot select gfp_mask
>>>>> with this API.
>>>> I think gfp_mask must be passed explicitly.
>>> Agreed.
>> It would only make sense if __vmalloc() can be called in atomic contexts.
>>
>> __vmalloc() cannot be called from irq contexts due to it taking
>> non-irq-safe spinlocks.
>>
>> __vmalloc() kinda looks like it could be called from non-irq atomic
>> contexts with GFP_ATOMIC, but I think it lies. For example,
>> pud_alloc_one/pmd_alloc_one/etc use hard-wired GFP_KERNEL.
>
> vmalloc/vfree / vmap/vunmap I think could now be made to be usable even
> in irq context, I think. Freeing up vmalloc space with global tlb flush
> can't be done from interrupt context, but now with the lazy unmapping,
> you only have to mark the area as freed (and possibly kick off a thread
> to do the actual unmapping).
>
> I didn't actually add that, because yes it would increase overheads a
> bit, and I would still prefer to wait for a real nice problem it solves
> before adding such a capability...
>
>
>> In which case this new allocation function can only be called from
>> contexts where GFP_KERNEL can be used, hence we don't need to pass that
>> in - it would be misleading to do so.
>>
>> In fact it's not immediately clear why __vmalloc() takes a gfp_t
>> argument either?
>
> Possibly a bugcheck for !GFP_WAIT || !GFP_FS || !GFP_IO, or a might_sleep()
> or something would be a good idea to add...
>
>
>
Thanks.
Now, new patch for it is: http://lkml.org/lkml/2008/11/17/137
Lai.
next prev parent reply other threads:[~2008-11-18 5:20 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-16 4:33 [PATCH 1/7] mm: introduce simple_malloc()/simple_free() Lai Jiangshan
2008-11-16 4:49 ` Alexey Dobriyan
2008-11-16 8:14 ` David Miller
2008-11-16 18:42 ` KOSAKI Motohiro
2008-11-16 4:52 ` Arjan van de Ven
2008-11-16 5:03 ` Andrew Morton
2008-11-16 5:35 ` Lai Jiangshan
2008-11-16 5:47 ` Andrew Morton
2008-11-16 5:53 ` Arjan van de Ven
2008-11-16 6:08 ` Eric Dumazet
2008-11-16 8:23 ` David Miller
2008-11-16 8:21 ` David Miller
2008-11-16 8:19 ` David Miller
2008-11-16 18:57 ` Arjan van de Ven
2008-11-16 21:39 ` Dave Airlie
2008-11-16 21:51 ` Arjan van de Ven
2008-11-16 22:42 ` Dave Airlie
2008-11-17 2:08 ` Lai Jiangshan
2008-11-17 4:53 ` Balbir Singh
2008-11-17 5:25 ` KAMEZAWA Hiroyuki
2008-11-17 6:43 ` KOSAKI Motohiro
2008-11-17 7:13 ` Andrew Morton
2008-11-17 7:15 ` David Miller
2008-11-17 8:10 ` KOSAKI Motohiro
2008-11-17 8:24 ` Balbir Singh
2008-11-18 4:39 ` Nick Piggin
2008-11-18 5:16 ` Lai Jiangshan [this message]
2008-11-17 4:46 ` Balbir Singh
2008-11-17 4:43 ` Balbir Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49224FBC.2000702@cn.fujitsu.com \
--to=laijs@cn.fujitsu.com \
--cc=adobriyan@gmail.com \
--cc=airlied@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=jack@suse.cz \
--cc=jens.axboe@oracle.com \
--cc=jes@sgi.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@google.com \
--cc=nickpiggin@yahoo.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox