From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Chinner Subject: Re: VFS hot tracking: How to calculate data temperature? Date: Mon, 5 Nov 2012 19:35:42 +1100 Message-ID: <20121105083542.GK29378@dastard> References: <20121102084109.GA19753@gmail.com> <20121102201048.GA20993@blackbox.djwong.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Zhi Yong Wu , linux-fsdevel@vger.kernel.org, linuxram@linux.vnet.ibm.com, cmm@us.ibm.com, Ben Chociej , James Northrup To: "Darrick J. Wong" Return-path: Received: from ipmail07.adl2.internode.on.net ([150.101.137.131]:39628 "EHLO ipmail07.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752835Ab2KEIfo (ORCPT ); Mon, 5 Nov 2012 03:35:44 -0500 Content-Disposition: inline In-Reply-To: <20121102201048.GA20993@blackbox.djwong.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Nov 02, 2012 at 01:10:48PM -0700, Darrick J. Wong wrote: > On Fri, Nov 02, 2012 at 04:41:09PM +0800, Zheng Liu wrote: > > On Fri, Nov 02, 2012 at 02:38:29PM +0800, Zhi Yong Wu wrote: > > > Here also has another question. > > > > > > How to save the file temperature among the umount to be able to > > > preserve the file tempreture after reboot? > > > > > > This above is the requirement from DB product. > > > I thought that we can save file temperature in its inode struct, that > > > is, add one new field in struct inode, then this info will be written > > > to disk with inode. > > > > > > Any comments or ideas are appreciated, thanks. > > > > Hi Zhiyong, > > > > I think that we might define a callback function. If a filesystem wants > > to save these data, it can implement a function to save them. The > > filesystem can decide whether adding it or not by themselves. > > > > BTW, actually I don't really care about how to save these data because I > > only want to observe which file is accessed in real time, which is very > > useful for me to track a problem in our product system. > > I _think_ the vfs quota code simply asks the filesystem for a special > inode where it save the quota data in whatever (FS-agnostic) format it wants. > Have you considered something like that? Doesn't make a lot of sense because the data is per-inode. Storing it per-inode is the only way it can be efficiently stored and indexed as it is accessed at the same time the inode is accessed. Quota information, OTOH, is per user/group/project - they are shared structures and have a completely different lookup and index mechanism to per-inode data structures. Henc eI don't think that the quota model would be a good fit for such data. Cheers, Dave. -- Dave Chinner david@fromorbit.com