lkml.org 
[lkml]   [2017]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 06/13] lockdep: Implement crossrelease feature
On Tue, Feb 28, 2017 at 10:28:20PM +0900, Byungchul Park wrote:
> On Tue, Feb 28, 2017 at 02:05:13PM +0100, Peter Zijlstra wrote:
> > On Wed, Jan 18, 2017 at 10:17:32PM +0900, Byungchul Park wrote:
> > > +#define MAX_XHLOCKS_NR 64UL
> >
> > > +#ifdef CONFIG_LOCKDEP_CROSSRELEASE
> > > + if (tsk->xhlocks) {
> > > + void *tmp = tsk->xhlocks;
> > > + /* Disable crossrelease for current */
> > > + tsk->xhlocks = NULL;
> > > + vfree(tmp);
> > > + }
> > > +#endif
> >
> > > +#ifdef CONFIG_LOCKDEP_CROSSRELEASE
> > > + p->xhlock_idx = 0;
> > > + p->xhlock_idx_soft = 0;
> > > + p->xhlock_idx_hard = 0;
> > > + p->xhlock_idx_nmi = 0;
> > > + p->xhlocks = vzalloc(sizeof(struct hist_lock) * MAX_XHLOCKS_NR);
> >
> > I don't think we need vmalloc for this now.
>
> Really? When is a better time to do it?
>
> I think the time creating a task is the best time to initialize it. No?

The place is fine, but I would use kmalloc() now (and subsequently kfree
on the other end) for the allocation. Its not _that_ large anymore,
right?

\
 
 \ /
  Last update: 2017-02-28 14:37    [W:0.214 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site