[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=mcrGTMBonxby1gR1OijPB4z072i6cNsLxNU09@mail.gmail.com>
Date: Fri, 30 Jul 2010 13:53:36 +0300
From: Pekka Enberg <penberg@...helsinki.fi>
To: John Johansen <john.johansen@...onical.com>
Cc: linux-kernel@...r.kernel.org,
linux-security-module@...r.kernel.org,
Nick Piggin <npiggin@...e.de>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Andrew Morton <akpm@...ux-foundation.org>, xiaosuo@...il.com,
laijs@...fujitsu.com
Subject: Re: [PATCH 01/13] AppArmor: misc. base functions and defines
On Fri, Jul 30, 2010 at 1:01 PM, John Johansen
<john.johansen@...onical.com> wrote:
>>> +/**
>>> + * kvfree - free an allocation do by kvmalloc
>>> + * @buffer: buffer to free (MAYBE_NULL)
>>> + *
>>> + * Free a buffer allocated by kvmalloc
>>> + */
>>> +void kvfree(void *buffer)
>>> +{
>>> + if (is_vmalloc_addr(buffer)) {
>>> + /* Data is no longer valid so just use the allocated space
>>> + * as the work_struct
>>> + */
>>> + struct work_struct *work = (struct work_struct *) buffer;
>>> + INIT_WORK(work, do_vfree);
>>> + schedule_work(work);
>>
>> I don't understand this part here. Is it needed for interrupt contexts
>> or does vfree() sleep somewhere? If it's for the former, I think we
>> can just add a comment saying that kvmalloc/kvfree is not safe from
>> interrupt context and remove the schedule_work() parts here.
>
> vfree can sleep, and skipping the schedule_work parts won't work for
> apparmor as many of these allocations are being freed via rcu callbacks
> as most of our object life cycles are dependent on cred refcounting.
Can someone point me to where vfree() actually sleeps? I'm unable to
find the exact spot.
--
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