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/