lkml.org 
[lkml]   [2014]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] lockdep: pack subclass/trylock/read/check into a single argument
On Tue, 21 Jan 2014 19:43:10 +0100
Oleg Nesterov <oleg@redhat.com> wrote:

> On 01/21, Dave Jones wrote:
> >
> > On Tue, Jan 21, 2014 at 03:10:22PM +0100, Peter Zijlstra wrote:
> > >
> > > I tried the below but filed to see my vmlinux shrink, maybe I'm just not
> > > building the right kernel, or otherwise GCC is stupid.
> > >
> > > -extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass,
> > > - int trylock, int read, int check,
> > > - struct lockdep_map *nest_lock, unsigned long ip);
> > > +struct lockdep_acquire_flags {
> > > + unsigned long subclass : 3;
> > > + unsigned long trylock : 1;
> > > + unsigned long read : 2;
> > > + unsigned long check : 1;
> > > +};
> >
> > As it's only 7 bits here, could we pack them into a char ?
>
> Do you mean __attribute__((packed)) ?
>

I think Dave means:

unsigned char subclass : 3;
unsigned char trylock : 1;
unsigned char read : 2;
unsigned char check : 1;

-- Steve


\
 
 \ /
  Last update: 2014-01-21 20:21    [W:0.108 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site