From: majianpeng <majianpeng@gmail.com>
To: sage <sage@inktank.com>
Cc: ceph-devel <ceph-devel@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Re: [PATCH 1/3] mds: update atime if client can read.
Date: Wed, 3 Jul 2013 09:25:39 +0800 [thread overview]
Message-ID: <201307030925331606702@gmail.com> (raw)
In-Reply-To: alpine.DEB.2.00.1307020946520.1067@cobra.newdream.net
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 2764 bytes --]
>On Tue, 2 Jul 2013, majianpeng wrote:
>> Now, update atime only for CEPH_CAP_FILE_EXCL.Change this if
>> CEPH_CAP_FILE_RD.
>
>Can we introduce a global config optoin (bool mds_atime in
>common/config_opts.h, maybe) so that users can turn this off? And/or add
>a 'relatime' option? More users won't want this as it is very expensive
>to maintain this extra level of metadata.
>
I don't know other client except cephfs.So the patch is from the view of using cephfs.
For cephfs,we can mount using 'noatime' to indicate don't update atime.
But for the other client, i don't know.
I think this should controled by client not server.
>That aside, this approach looks right to me. :)
>
>Thanks!
>sage
>
>
> >
>> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
>> ---
>> src/mds/Locker.cc | 15 +++++++++------
>> 1 file changed, 9 insertions(+), 6 deletions(-)
>>
>> diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc
>> index 30e014a..58f953f 100644
>> --- a/src/mds/Locker.cc
>> +++ b/src/mds/Locker.cc
>> @@ -2676,8 +2676,9 @@ void Locker::_do_snap_update(CInode *in, snapid_t snap, int dirty, snapid_t foll
>> void Locker::_update_cap_fields(CInode *in, int dirty, MClientCaps *m, inode_t *pi)
>> {
>> // file
>> + utime_t atime = m->get_atime();
>> +
>> if (dirty & (CEPH_CAP_FILE_EXCL|CEPH_CAP_FILE_WR)) {
>> - utime_t atime = m->get_atime();
>> utime_t mtime = m->get_mtime();
>> utime_t ctime = m->get_ctime();
>> uint64_t size = m->get_size();
>> @@ -2700,11 +2701,7 @@ void Locker::_update_cap_fields(CInode *in, int dirty, MClientCaps *m, inode_t *
>> pi->size = size;
>> pi->rstat.rbytes = size;
>> }
>> - if ((dirty & CEPH_CAP_FILE_EXCL) && atime != pi->atime) {
>> - dout(7) << " atime " << pi->atime << " -> " << atime
>> - << " for " << *in << dendl;
>> - pi->atime = atime;
>> - }
>> +
>> if ((dirty & CEPH_CAP_FILE_EXCL) &&
>> ceph_seq_cmp(pi->time_warp_seq, m->get_time_warp_seq()) < 0) {
>> dout(7) << " time_warp_seq " << pi->time_warp_seq << " -> " << m->get_time_warp_seq()
>> @@ -2712,6 +2709,12 @@ void Locker::_update_cap_fields(CInode *in, int dirty, MClientCaps *m, inode_t *
>> pi->time_warp_seq = m->get_time_warp_seq();
>> }
>> }
>> +
>> + if ((dirty & CEPH_CAP_FILE_RD) && atime > pi->atime) {
>> + dout(7) << " atime " << pi->atime << " -> " << atime
>> + << " for " << *in << dendl;
>> + pi->atime = atime;
>> + }
>> // auth
>> if (dirty & CEPH_CAP_AUTH_EXCL) {
>> if (m->head.uid != pi->uid) {
>> --
>> 1.8.3.rc1.44.gb387c77
>> ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
prev parent reply other threads:[~2013-07-03 1:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-02 5:45 [PATCH 1/3] mds: update atime if client can read majianpeng
2013-07-02 16:48 ` Sage Weil
2013-07-03 1:25 ` majianpeng [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201307030925331606702@gmail.com \
--to=majianpeng@gmail.com \
--cc=ceph-devel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sage@inktank.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox