Re: [RFC 1/6] Framework

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +#define global_page_state(__x) atomic_long_read(&vm_stat[__x])
> +#define zone_page_state(__z,__x) atomic_long_read(&(__z)->vm_stat[__x])
> +extern unsigned long node_page_state(int node, enum zone_stat_item);
> +
> +/*
> + * For use when we know that interrupts are disabled.

Why do you need to disable interupts for atomic_t ? 
If you just want to prevent switching CPUs that could be 
done with get_cpu(), but alternatively you could just ignore
that race (it wouldn't be a big issue to still increment
the counter on the old CPU)

And why atomic and not just local_t?  On x86/x86-64 local_t
would be much cheaper at least. It's not long, but that could
be as well added.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux