From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932654Ab2KFI06 (ORCPT ); Tue, 6 Nov 2012 03:26:58 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:49990 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932149Ab2KFI05 (ORCPT ); Tue, 6 Nov 2012 03:26:57 -0500 Date: Tue, 6 Nov 2012 16:39:18 +0800 From: Zheng Liu To: Zhi Yong Wu Cc: linux-fsdevel@vger.kernel.org, linuxram@linux.vnet.ibm.com, Dave Chinner , cmm@us.ibm.com, Ben Chociej , James Northrup , linux-kernel mlist Subject: Re: VFS hot tracking: How to calculate data temperature? Message-ID: <20121106083918.GA6090@gmail.com> Mail-Followup-To: Zhi Yong Wu , linux-fsdevel@vger.kernel.org, linuxram@linux.vnet.ibm.com, Dave Chinner , cmm@us.ibm.com, Ben Chociej , James Northrup , linux-kernel mlist References: <20121102084109.GA19753@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 05, 2012 at 10:29:39AM +0800, Zhi Yong Wu wrote: > On Fri, Nov 2, 2012 at 4:41 PM, 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. > Great idea, temperature saving function is maybe very specific to FS. > But i am wondering if we can find one generic way to save temperature > info at first. I don't think a generic way is better because it cannot support a variety of filesystems. So maybe you must answer this question firstly: how many filesystems do you want to save this info? such as ext4, xfs, btrfs, etc. Then we can try to find a generic way. If only these three filesystems you want to support, maybe saving in xattr is an optional way. Regards, Zheng