Re: [PATCH 2/3] percpu_stats: Simple per-cpu statistics count helper functions

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

 



On 04/06/2016 06:54 PM, Tejun Heo wrote:
Hello,

On Wed, Apr 06, 2016 at 05:51:45PM -0400, Waiman Long wrote:
+	/*
+	 * If a statistics count is in the middle of being updated, it
+	 * is possible that the above clearing may not work. So we need
+	 * to double check again to make sure that the counters are really
+	 * cleared. Still there is a still a very small chance that the
+	 * second clearing does not work.
+	 */
+	for_each_possible_cpu(cpu) {
+		unsigned long *pstats =  per_cpu_ptr(pcs->stats, cpu);
+		int stat;
+
+		for (stat = 0; stat<   pcs->nstats; stat++, pstats++)
+			if (*pstats)
+				*pstats = 0;
+	}
I don't think this is acceptable.
I am not sure what you mean here by not acceptable. Please enlighten me on
that.
Hmmm... I thought that was pretty clear.  Try-twice-and-we-are-probably-okay
is simply not acceptable.  Please make it watertight.

Thanks.

OK, I got it now.

We can certainly make it watertight. However, that will certainly require adding performance overhead in the percpu stats update fast path which I am not willing to pay.

The purpose of this stat counters reset functionality is to allow developers to reset the stat counters, run certain workload and see how things are going in the kernel when the workload completes assuming that those stat counters are exposed via sysfs, debugfs, etc. The developers can certainly check the stat counters after the reset to make sure that they are properly reset. So I don't think we need an airtight way of doing it. If you have scenarios in your mind that require airtight reset of the stat counters, please let me know and I will see what I can do about it.

Cheers,
Longman
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux