lkml.org 
[lkml]   [2008]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 3/4] IPMI: convert locked counters to atomics
    On Thu, 14 Feb 2008 13:33:10 -0600
    Corey Minyard <minyard@acm.org> wrote:

    > Andrew Morton wrote:
    > >> + for (i = 0; i < IPMI_NUM_STATS; i++)
    > >> + atomic_set(&intf->stats[i], 0);
    > >>
    > >
    > > And this is why it would be very hard for any architecture to ever
    > > implement atomic_t as
    > >
    > > struct atomic_t {
    > > int counter;
    > > spinlock_t lock;
    > > };
    > >
    > > The interface assumes that atomic_set() fully initialises the atomic_t, and
    > > that atomic_set() can be used agaisnt both an uninitialised atomic_t and
    > > against an already-initialised atomic_t. IOW, we don't have atomic_init().
    > >
    > > So would our hypothetical future architcture's atomic_set() do spin_lock(),
    > > or would it do spin_lock_init()? Either one is wrong in many atomic_set
    > > callsites.
    > >
    > > Oh well.
    > >
    > Yeah, I thought the same thing when I did this. Do we start working
    > on an atomic_init()? It would be easy enough to set it to atomic_set()
    > for current architectures.

    I suppose we should, but I can't say I'm terribly excited by the prospect ;)


    \
     
     \ /
      Last update: 2008-02-14 21:27    [W:0.021 / U:0.776 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site