Nick Piggin a écrit :
OK, well I would prefer you do the proper atomic operations throughout where it "really matters" in file_table.c, and do your lazy synchronize with just the sysctl exported value.
But... I got complains about atomic_read(&counter) being 'an atomic op' (untrue), so my second patch just doesnt touch the path where nr_files was read.
Furthermore, a lazy sync would mean to change sysctl proc_handler for "file-nr" to perform a synchronize before calling proc_dointvec, this would be really obscure.
Unless the fs people had a problem with that. And you may as well get rid of the atomic_inc_return which can be more expensive on some platforms and doesn't buy you much. atomic_inc; atomic_read; Should be enough if you don't care about lost updates here, yeah?
You mean : atomic_inc(&counter); lazeyvalue = atomic_read(&counter); instead of lazeyvalue = atomic_inc_return(&counter); In fact I couldnt find one architecture where the later would be more expensive.
Nick
Eric - 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/
- Follow-Ups:
- Re: [PATCH] removes filp_count_lock and changes nr_files type to atomic_t
- From: Nick Piggin <[email protected]>
- Re: [PATCH] removes filp_count_lock and changes nr_files type to atomic_t
- From: Dipankar Sarma <[email protected]>
- Re: [PATCH] removes filp_count_lock and changes nr_files type to atomic_t
- References:
- [patch] Additions to .data.read_mostly section
- From: Ravikiran G Thirumalai <[email protected]>
- Re: [patch] Additions to .data.read_mostly section
- From: Arjan van de Ven <[email protected]>
- [PATCH] removes filp_count_lock and changes nr_files type to atomic_t
- From: Eric Dumazet <[email protected]>
- Re: [PATCH] removes filp_count_lock and changes nr_files type to atomic_t
- From: Christoph Hellwig <[email protected]>
- Re: [PATCH] removes filp_count_lock and changes nr_files type to atomic_t
- From: Eric Dumazet <[email protected]>
- Re: [PATCH] removes filp_count_lock and changes nr_files type to atomic_t
- From: Christoph Hellwig <[email protected]>
- Re: [PATCH] removes filp_count_lock and changes nr_files type to atomic_t
- From: Eric Dumazet <[email protected]>
- Re: [PATCH] removes filp_count_lock and changes nr_files type to atomic_t
- From: Nick Piggin <[email protected]>
- Re: [PATCH] removes filp_count_lock and changes nr_files type to atomic_t
- From: Eric Dumazet <[email protected]>
- Re: [PATCH] removes filp_count_lock and changes nr_files type to atomic_t
- From: Nick Piggin <[email protected]>
- [patch] Additions to .data.read_mostly section
- Prev by Date: Re: [RFC] RT-patch update to remove the global pi_lock
- Next by Date: Re: [PATCH 5/5] Remove unnecesary capability hooks in rootplug.
- Previous by thread: Re: [PATCH] removes filp_count_lock and changes nr_files type to atomic_t
- Next by thread: Re: [PATCH] removes filp_count_lock and changes nr_files type to atomic_t
- Index(es):