lkml.org 
[lkml]   [2010]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 01/13] AppArmor: misc. base functions and defines
From
On Fri, Jul 30, 2010 at 1:01 PM, John Johansen
<john.johansen@canonical.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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-07-30 12:55    [W:0.065 / U:11.860 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site