[squid-users] Re: Linux EXT3 optimizations for Squid

From: Heinz Diehl <htd_at_fancy-poultry.org>
Date: Sun, 8 Aug 2010 22:45:19 +0200

On 08.08.2010, Marcus Kool wrote:

> Hmmm. maybe it is. some messages on the internet indicate that.

Here's the relevant code of the Linux kernel (fs/inode.c), as you can see, NODIRATIME
isn't even getting checked if NOATIME is specified, the function returns
immediately.

/**
*touch_atime-update the access time
*@mnt: mount the inode is accessed on
*@dentry: dentry accessed
*
*Update the accessed time on an inode and mark it for writeback.
*This function automatically handles read only file systems and media,
*as well as the "noatime" flag and inode specific "noatime" markers.
*/

void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
  {
  struct inode *inode = dentry->d_inode;
  struct timespec now;
  
  if (inode->i_flags & S_NOATIME)
  return;
  if (IS_NOATIME(inode))
  return;
  if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))
  return;
  
  if (mnt->mnt_flags & MNT_NOATIME)
  return;
  if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
  return;
  
  now = current_fs_time(inode->i_sb);
  
  if (!relatime_need_update(mnt, inode, now))
  return;
  
  if (timespec_equal(&inode->i_atime, &now))
  return;
  
  if (mnt_want_write(mnt))
  return;
  
  inode->i_atime = now;
  mark_inode_dirty_sync(inode);
  mnt_drop_write(mnt);
}

> The man page does not indicate anything but since directories are also files
> it is not unlogical that atime is a superset of nodiratime.

Yes.
Received on Sun Aug 08 2010 - 20:45:26 MDT

This archive was generated by hypermail 2.2.0 : Mon Aug 09 2010 - 12:00:02 MDT