From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phillip Susi Subject: Re: Tracking actual disk write sources instead of flush thread Date: Wed, 23 Apr 2014 21:39:07 -0400 Message-ID: <53586B3B.7000406@ubuntu.com> References: <534DE477.5080904@ubuntu.com> <20140416140147.GA15429@linux.intel.com> <534E9E9D.5030600@ubuntu.com> <4C30833E5CDF444D84D942543DF65BDA625F51A9@G4W3303.americas.hpqcorp.net> <534EC964.6080702@ubuntu.com> <4C30833E5CDF444D84D942543DF65BDA625F5246@G4W3303.americas.hpqcorp.net> <534ED9B8.9090605@ubuntu.com> <20140423134805.GB13050@linux.intel.com> <535816E7.2070106@ubuntu.com> <68A83B3D-D029-4863-B9D9-2BD9894FDFDC@dilger.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Matthew Wilcox , "Zuckerman, Boris" , "linux-fsdevel@vger.kernel.org" To: Andreas Dilger Return-path: Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.226]:58339 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751102AbaDXBjJ (ORCPT ); Wed, 23 Apr 2014 21:39:09 -0400 In-Reply-To: <68A83B3D-D029-4863-B9D9-2BD9894FDFDC@dilger.ca> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 04/23/2014 07:19 PM, Andreas Dilger wrote: > I think that adding a pointer or integer per page would meet > resistance, but I think it is pretty reasonable to track this on a > per-inode basis. It is fairly uncommon to have multiple threads > writing to the same file, and I would guess it is vanishingly rare > that different applications are writing to the same file at one > time. Wherever the current counter is should be fine, the question is when it gets updated. Rather than updating it on sync it just needs updated on actual write() / page dirty. > Storing {current->comm}.{pid} would take 20 bytes of space per > inode, but would be much more useful than just storing {pid}, since > a process may be long gone by the time that the blocks are even > submitted to disk due to delayed allocation and such. > > It would be possible to store a refcounted struct with this info > pointed to from the inode, since it would only be useful on inodes > being written, but that has to be balanced against the complexity > of maintaining that struct and the potential of saving 12 bytes per > inode (since there would still need to be a pointer in the inode). That might be a bit overkill. I believe the current interface just has a counter of bytes of IO hung off the task, so you can't catch very short lived processes. That's probably not too bad. I don't think it needs tracked on a per inode basis; just being able to sort out that this process is doing the writing instead of some other random process or the flush task that actually ends up submitting the bio. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCgAGBQJTWGs7AAoJEI5FoCIzSKrwbiUH/iCQYRn74zTt/G1pSVEKiNCj +j0AL004tkU8UHZkgUvTedYzMyaqy5gs59IahwuPX+u/U6jRIUElrkBpecL5E+q/ OgfL+g/HybC0YbMJDKWedjRshxwHyjLLhRuPxTPSLXLxOPj8ZCvhzg2Hc2UkswJ5 /mIiWlKt70Ezxf2sq4Xnna8nGk6iuTlNqCc/VkB/AOu+aSsYcdIkoi1T/O+vUMHz uRUwVuo+grn85NdRjpL0l7sXT1FJaJsbQkjy72akiBEDWN4J/3w48ZaoHr1Gv7tB uCgWmZgPdQYeftkK0gnU7MSbWplcr7VrwdnYr9BdzEluKaX6I0vxejbpPYcAwOo= =p1rv -----END PGP SIGNATURE-----