All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NFS: Add acreg{min,max} and acdir{min,max} in milliseconds
@ 2009-06-10  1:32 Amit Gud
  2009-06-10 12:27 ` Trond Myklebust
  0 siblings, 1 reply; 15+ messages in thread
From: Amit Gud @ 2009-06-10  1:32 UTC (permalink / raw)
  To: linux-nfs; +Cc: steved, gud-OYTqUY/oFF8, Uhlenkott, Jason

VGhpcyBwYXRjaCBhZGRzIDQgbmV3IE5GUyBtb3VudCBvcHRpb25zKGFjZGlybWlubXMsIGFjZGly
bWF4bXMsIGFjcmVnbWlubXMsCmFjcmVnbWF4bXMpIGNvbnZlcnRpbmcgYWxyZWFkeSBleGlzdGlu
ZyBvbmUgaW50byBhIG1pbGxpc2Vjb25kIHJlc29sdXRpb24KaW5zdGVhZCBvZiBzZWNvbmRzLgoK
QWxzbywgbW9kaWZpZXMgdGhlIG1vdW50c3RhdHMgb3V0cHV0IHRvIG1pbGxpc2Vjb25kcyBpbnN0
ZWFkIG9mIHNlY29uZHMuCgpTaWduZWQtb2ZmLWJ5OiBBbWl0IEd1ZCA8YWd1ZEBha2FtYWkuY29t
PgoKQUcKLS0KTWF5IHRoZSBzb3VyY2Ugd2l0aCB5b3UuCmh0dHA6Ly93d3cuY2lzLmtzdS5lZHUv
fmd1ZAoKSW5kZXg6IGxpbnV4LTIuNi9mcy9uZnMvY2xpZW50LmMKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gbGlu
dXgtMi42Lm9yaWcvZnMvbmZzL2NsaWVudC5jCisrKyBsaW51eC0yLjYvZnMvbmZzL2NsaWVudC5j
CkBAIC03NzIsMTAgKzc3MiwxMCBAQCBzdGF0aWMgaW50IG5mc19pbml0X3NlcnZlcihzdHJ1Y3Qg
bmZzX3NlCiAJaWYgKGRhdGEtPndzaXplKQogCQlzZXJ2ZXItPndzaXplID0gbmZzX2Jsb2NrX3Np
emUoZGF0YS0+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9BQ0RJUk1JTgkoMzApCi0jZGVmaW5lIE5GU19ERUZfQUNESVJNQVgJKDYwKQorI2Rl
ZmluZSBORlNfREVGX0FDUkVHTUlOX01TCSgzMDAwKQorI2RlZmluZSBORlNfREVGX0FDUkVHTUFY
X01TCSg2MDAwMCkKKyNkZWZpbmUgTkZTX0RFRl9BQ0RJUk1JTl9NUwkoMzAwMDApCisjZGVmaW5l
IE5GU19ERUZfQUNESVJNQVhfTVMJKDYwMDAwKQogCiAvKgogICogV2hlbiBmbHVzaGluZyBhIGNs
dXN0ZXIgb2YgZGlydHkgcGFnZXMsIHRoZXJlIGNhbiBiZSBkaWZmZXJlbnQKAAo=

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] NFS: Add acreg{min,max} and acdir{min,max} in milliseconds
  2009-06-10  1:32 [PATCH] NFS: Add acreg{min,max} and acdir{min,max} in milliseconds Amit Gud
@ 2009-06-10 12:27 ` Trond Myklebust
       [not found]   ` <1244636844.24750.23.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Trond Myklebust @ 2009-06-10 12:27 UTC (permalink / raw)
  To: Amit Gud; +Cc: linux-nfs, steved, gud-OYTqUY/oFF8, Uhlenkott, Jason

On Tue, 2009-06-09 at 18:32 -0700, Amit Gud wrote:
> This patch adds 4 new NFS mount options(acdirminms, acdirmaxms, acregminms,
> acregmaxms) converting already existing one into a millisecond resolution
> instead of seconds.
> 
> Also, modifies the mountstats output to milliseconds instead of seconds.

Why, exactly, do you need to control cache timeouts down to the
millisecond level?

Trond


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] NFS: Add acreg{min,max} and acdir{min,max} in milliseconds
       [not found]   ` <1244636844.24750.23.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
@ 2009-06-10 19:43     ` Amit Gud
  2009-06-11  0:11       ` Trond Myklebust
  0 siblings, 1 reply; 15+ messages in thread
From: Amit Gud @ 2009-06-10 19:43 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs, steved, gud-OYTqUY/oFF8, Uhlenkott, Jason

Trond Myklebust wrote:
> On Tue, 2009-06-09 at 18:32 -0700, Amit Gud wrote:
>> This patch adds 4 new NFS mount options(acdirminms, acdirmaxms, acregminms,
>> acregmaxms) converting already existing one into a millisecond resolution
>> instead of seconds.
>>
>> Also, modifies the mountstats output to milliseconds instead of seconds.
> 
> Why, exactly, do you need to control cache timeouts down to the
> millisecond level?
> 

The problem is to make the updates visible from one client to the other
in less than a second and turning off caching entirely has an
unacceptably high penalty.


AG
--
May the source be with you.
http://www.cis.ksu.edu/~gud

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] NFS: Add acreg{min,max} and acdir{min,max} in milliseconds
  2009-06-10 19:43     ` Amit Gud
@ 2009-06-11  0:11       ` Trond Myklebust
  2009-06-11 20:24         ` Amit Gud
  0 siblings, 1 reply; 15+ messages in thread
From: Trond Myklebust @ 2009-06-11  0:11 UTC (permalink / raw)
  To: Amit Gud; +Cc: linux-nfs, Steve Dickson, gud-OYTqUY/oFF8, Uhlenkott, Jason

On Jun 10, 2009, at 15:43, Amit Gud <agud@akamai.com> wrote:

> Trond Myklebust wrote:
>> On Tue, 2009-06-09 at 18:32 -0700, Amit Gud wrote:
>>> This patch adds 4 new NFS mount options(acdirminms, acdirmaxms,  
>>> acregminms,
>>> acregmaxms) converting already existing one into a millisecond  
>>> resolution
>>> instead of seconds.
>>>
>>> Also, modifies the mountstats output to milliseconds instead of  
>>> seconds.
>>
>> Why, exactly, do you need to control cache timeouts down to the
>> millisecond level?
>>
>
> The problem is to make the updates visible from one client to the  
> other
> in less than a second and turning off caching entirely has an
> unacceptably high penalty.

Specifics, please: updates of what, exactly? Are we talking  
attributes, data or directory contents?

What is your application, and why does 1ms constitute an acceptable  
caching timeout, while 1s does not?

Trond

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] NFS: Add acreg{min,max} and acdir{min,max} in milliseconds
  2009-06-11  0:11       ` Trond Myklebust
@ 2009-06-11 20:24         ` Amit Gud
  2009-06-11 21:14           ` Trond Myklebust
  0 siblings, 1 reply; 15+ messages in thread
From: Amit Gud @ 2009-06-11 20:24 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs, Steve Dickson, gud, Uhlenkott, Jason

Trond Myklebust wrote:
> On Jun 10, 2009, at 15:43, Amit Gud <agud@akamai.com> wrote:
> 
>> Trond Myklebust wrote:
>>> On Tue, 2009-06-09 at 18:32 -0700, Amit Gud wrote:
>>>> This patch adds 4 new NFS mount options(acdirminms, acdirmaxms,
>>>> acregminms,
>>>> acregmaxms) converting already existing one into a millisecond
>>>> resolution
>>>> instead of seconds.
>>>>
>>>> Also, modifies the mountstats output to milliseconds instead of
>>>> seconds.
>>>
>>> Why, exactly, do you need to control cache timeouts down to the
>>> millisecond level?
>>>
>>
>> The problem is to make the updates visible from one client to the other
>> in less than a second and turning off caching entirely has an
>> unacceptably high penalty.
> 
> Specifics, please: updates of what, exactly? Are we talking attributes,
> data or directory contents?
> 
> What is your application, and why does 1ms constitute an acceptable
> caching timeout, while 1s does not?
> 

We have a system in which machine A needs a change made to an NFS
directory.  But, the actual change must be executed by machine B, so A
makes an request to B to make the update.  But, A is allowed to read
the directory directly, so A can't in general continue until it is
able to see the effect of the update.  With 1s caching, that means a
1s "sleep" after each update.

Setting caching to "0s" means that consecutive stats performed by
machine A must always revalidate every node of each path walked.  In
many cases, we end up wanting to stat every path component in some
path, which would result in O(N2) getattr or lookup calls for N
levels of directory depth.

Using a very small acdirmax (e.g. 10ms) gives us a significant
performance boost on these consecutive stats without increasing the
post-update "sleep" to 1s.  (Of course, if the file server delays more
than 10ms at any step, then we will have to start over for the next
operation.  But, the file server often has everything necessary in
cache such that each response is well below a millisecond.)


AG
--
May the source be with you.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] NFS: Add acreg{min,max} and acdir{min,max} in milliseconds
  2009-06-11 20:24         ` Amit Gud
@ 2009-06-11 21:14           ` Trond Myklebust
       [not found]             ` <1244754888.5047.132.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Trond Myklebust @ 2009-06-11 21:14 UTC (permalink / raw)
  To: Amit Gud; +Cc: linux-nfs, Steve Dickson, gud, Uhlenkott, Jason

On Thu, 2009-06-11 at 13:24 -0700, Amit Gud wrote:
> Trond Myklebust wrote:
> > On Jun 10, 2009, at 15:43, Amit Gud <agud@akamai.com> wrote:
> > 
> >> Trond Myklebust wrote:
> >>> On Tue, 2009-06-09 at 18:32 -0700, Amit Gud wrote:
> >>>> This patch adds 4 new NFS mount options(acdirminms, acdirmaxms,
> >>>> acregminms,
> >>>> acregmaxms) converting already existing one into a millisecond
> >>>> resolution
> >>>> instead of seconds.
> >>>>
> >>>> Also, modifies the mountstats output to milliseconds instead of
> >>>> seconds.
> >>>
> >>> Why, exactly, do you need to control cache timeouts down to the
> >>> millisecond level?
> >>>
> >>
> >> The problem is to make the updates visible from one client to the other
> >> in less than a second and turning off caching entirely has an
> >> unacceptably high penalty.
> > 
> > Specifics, please: updates of what, exactly? Are we talking attributes,
> > data or directory contents?
> > 
> > What is your application, and why does 1ms constitute an acceptable
> > caching timeout, while 1s does not?
> > 
> 
> We have a system in which machine A needs a change made to an NFS
> directory.  But, the actual change must be executed by machine B, so A
> makes an request to B to make the update.  But, A is allowed to read
> the directory directly, so A can't in general continue until it is
> able to see the effect of the update.  With 1s caching, that means a
> 1s "sleep" after each update.
> 
> Setting caching to "0s" means that consecutive stats performed by
> machine A must always revalidate every node of each path walked.  In
> many cases, we end up wanting to stat every path component in some
> path, which would result in O(N2) getattr or lookup calls for N
> levels of directory depth.
> 
> Using a very small acdirmax (e.g. 10ms) gives us a significant
> performance boost on these consecutive stats without increasing the
> post-update "sleep" to 1s.  (Of course, if the file server delays more
> than 10ms at any step, then we will have to start over for the next
> operation.  But, the file server often has everything necessary in
> cache such that each response is well below a millisecond.)

I'm still not sure I fully understand, but here are a couple of
comments.

Firstly, opendir() will _always_ force a revalidation of the directory
attributes, so if your machine A is relying on doing an 'ls' in order to
figure out the directory contents, then that shouldn't need extra
attribute timeouts.

Secondly, we have already introduced finer control over the lookup
caching as of Linux 2.6.28 and newer:
        - if you want to ensure that machine A always see new files and
        links immediately once they have been created, then
        '-olookupcache=positive' should turn off negative dentry
        caching.
        - if you also want to ensure that it immediately sees renames,
        unlinks and such, then '-olookupcache=none' will turn off lookup
        caching altogether.
Both of these lookup cache options are more reliable than relying on the
directory attribute cache timeouts, and they have the added benefit that
they also work around the problem that Linux servers tend to have poor
mtime resolution. A 1ms cache timeout on the client won't help you much
if the server only registers changes in 1s increments.

Trond


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] NFS: Add acreg{min,max} and acdir{min,max} in milliseconds
       [not found]             ` <1244754888.5047.132.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
@ 2009-06-12 19:30               ` Amit Gud
  2009-06-12 19:50                 ` Trond Myklebust
  0 siblings, 1 reply; 15+ messages in thread
From: Amit Gud @ 2009-06-12 19:30 UTC (permalink / raw)
  To: Trond Myklebust
  Cc: linux-nfs, Steve Dickson, gud-OYTqUY/oFF8, Uhlenkott, Jason

Trond Myklebust wrote:
> On Thu, 2009-06-11 at 13:24 -0700, Amit Gud wrote:
>> Trond Myklebust wrote:
>>> On Jun 10, 2009, at 15:43, Amit Gud <agud@akamai.com> wrote:
>>>
>>>> Trond Myklebust wrote:
>>>>> On Tue, 2009-06-09 at 18:32 -0700, Amit Gud wrote:
>>>>>> This patch adds 4 new NFS mount options(acdirminms, acdirmaxms,
>>>>>> acregminms,
>>>>>> acregmaxms) converting already existing one into a millisecond
>>>>>> resolution
>>>>>> instead of seconds.
>>>>>>
>>>>>> Also, modifies the mountstats output to milliseconds instead of
>>>>>> seconds.
>>>>> Why, exactly, do you need to control cache timeouts down to the
>>>>> millisecond level?
>>>>>
>>>> The problem is to make the updates visible from one client to the other
>>>> in less than a second and turning off caching entirely has an
>>>> unacceptably high penalty.
>>> Specifics, please: updates of what, exactly? Are we talking attributes,
>>> data or directory contents?
>>>
>>> What is your application, and why does 1ms constitute an acceptable
>>> caching timeout, while 1s does not?
>>>
>> We have a system in which machine A needs a change made to an NFS
>> directory.  But, the actual change must be executed by machine B, so A
>> makes an request to B to make the update.  But, A is allowed to read
>> the directory directly, so A can't in general continue until it is
>> able to see the effect of the update.  With 1s caching, that means a
>> 1s "sleep" after each update.
>>
>> Setting caching to "0s" means that consecutive stats performed by
>> machine A must always revalidate every node of each path walked.  In
>> many cases, we end up wanting to stat every path component in some
>> path, which would result in O(N2) getattr or lookup calls for N
>> levels of directory depth.
>>
>> Using a very small acdirmax (e.g. 10ms) gives us a significant
>> performance boost on these consecutive stats without increasing the
>> post-update "sleep" to 1s.  (Of course, if the file server delays more
>> than 10ms at any step, then we will have to start over for the next
>> operation.  But, the file server often has everything necessary in
>> cache such that each response is well below a millisecond.)
> 
> I'm still not sure I fully understand, but here are a couple of
> comments.
> 
> Firstly, opendir() will _always_ force a revalidation of the directory
> attributes, so if your machine A is relying on doing an 'ls' in order to
> figure out the directory contents, then that shouldn't need extra
> attribute timeouts.
> 
> Secondly, we have already introduced finer control over the lookup
> caching as of Linux 2.6.28 and newer:
>         - if you want to ensure that machine A always see new files and
>         links immediately once they have been created, then
>         '-olookupcache=positive' should turn off negative dentry
>         caching.
>         - if you also want to ensure that it immediately sees renames,
>         unlinks and such, then '-olookupcache=none' will turn off lookup
>         caching altogether.
> Both of these lookup cache options are more reliable than relying on the
> directory attribute cache timeouts, and they have the added benefit that
> they also work around the problem that Linux servers tend to have poor
> mtime resolution. A 1ms cache timeout on the client won't help you much
> if the server only registers changes in 1s increments.

Those options don't seem particularly useful.

Machine A doesn't necessarily use ls to figure out changes in the
directory content. So, revalidation of the directory attribute wouldn't
happen.

We definitely want lookup caching turned on, always, including both
positive and negative caching.  But, we need to see new files, unlinks,
and renames much quicker than a second.

And mtime resolution may not be a problem if NFS servers are not on Linux.


AG
--
May the source be with you.
http://www.cis.ksu.edu/~gud


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] NFS: Add acreg{min,max} and acdir{min,max} in milliseconds
  2009-06-12 19:30               ` Amit Gud
@ 2009-06-12 19:50                 ` Trond Myklebust
       [not found]                   ` <1244836259.19533.19.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Trond Myklebust @ 2009-06-12 19:50 UTC (permalink / raw)
  To: Amit Gud; +Cc: linux-nfs, Steve Dickson, gud-OYTqUY/oFF8, Uhlenkott, Jason

On Fri, 2009-06-12 at 12:30 -0700, Amit Gud wrote:
> We definitely want lookup caching turned on, always, including both
> positive and negative caching.  But, we need to see new files, unlinks,
> and renames much quicker than a second.

Then use the lookupcache option, since that's what it is for.

Trond


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] NFS: Add acreg{min,max} and acdir{min,max} in milliseconds
       [not found]                   ` <1244836259.19533.19.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
@ 2009-06-12 21:49                     ` Amit Gud
  2009-06-12 22:44                       ` Trond Myklebust
  0 siblings, 1 reply; 15+ messages in thread
From: Amit Gud @ 2009-06-12 21:49 UTC (permalink / raw)
  To: Trond Myklebust
  Cc: linux-nfs, Steve Dickson, gud-OYTqUY/oFF8, Uhlenkott, Jason

Trond Myklebust wrote:
> On Fri, 2009-06-12 at 12:30 -0700, Amit Gud wrote:
>> We definitely want lookup caching turned on, always, including both
>> positive and negative caching.  But, we need to see new files, unlinks,
>> and renames much quicker than a second.
> 
> Then use the lookupcache option, since that's what it is for.
> 

Sorry, I don't understand.

Copying from your last mail:

> Secondly, we have already introduced finer control over the lookup
> caching as of Linux 2.6.28 and newer:
>         - if you want to ensure that machine A always see new files and
>         links immediately once they have been created, then
>         '-olookupcache=positive' should turn off negative dentry
>         caching.
>         - if you also want to ensure that it immediately sees renames,
>         unlinks and such, then '-olookupcache=none' will turn off lookup
>         caching altogether.

How is it possible to _not_ disable any caching (positive or negative
dentries) and still be able to see renames, unlinks and such in << 1s?


AG
--
May the source be with you.
http://www.cis.ksu.edu/~gud

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] NFS: Add acreg{min,max} and acdir{min,max} in milliseconds
  2009-06-12 21:49                     ` Amit Gud
@ 2009-06-12 22:44                       ` Trond Myklebust
       [not found]                         ` <1244846673.32257.69.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Trond Myklebust @ 2009-06-12 22:44 UTC (permalink / raw)
  To: Amit Gud; +Cc: linux-nfs, Steve Dickson, gud-OYTqUY/oFF8, Uhlenkott, Jason

On Fri, 2009-06-12 at 14:49 -0700, Amit Gud wrote:
> Trond Myklebust wrote:
> > On Fri, 2009-06-12 at 12:30 -0700, Amit Gud wrote:
> >> We definitely want lookup caching turned on, always, including both
> >> positive and negative caching.  But, we need to see new files, unlinks,
> >> and renames much quicker than a second.
> > 
> > Then use the lookupcache option, since that's what it is for.
> > 
> 
> Sorry, I don't understand.
> 
> Copying from your last mail:
> 
> > Secondly, we have already introduced finer control over the lookup
> > caching as of Linux 2.6.28 and newer:
> >         - if you want to ensure that machine A always see new files and
> >         links immediately once they have been created, then
> >         '-olookupcache=positive' should turn off negative dentry
> >         caching.
> >         - if you also want to ensure that it immediately sees renames,
> >         unlinks and such, then '-olookupcache=none' will turn off lookup
> >         caching altogether.
> 
> How is it possible to _not_ disable any caching (positive or negative
> dentries) and still be able to see renames, unlinks and such in << 1s?

You could set acdirmin/acdirmax to 0, but that just floods your server
with GETATTR calls instead of LOOKUPs. Then again, so will your
millisecond acdirmin/acdirmax.
Furthermore, you would be adjusting the _attribute_ cache timeout (not
just the lookup cache), which comes at a cost to all the other
operations that depend on those attributes. IOW: readdir(), permissions
checking, stat() calls, ...

It boils down to this: I'm extremely reluctant to get into an arms race
of adding ever more mount options for increasingly finer-tuned attribute
cache timeouts. While such an option may meet _your_ machine room
requirements here and now, it becomes tiresome over the years as
machines gain power, and people first start lobbying for millisecond
timeouts, then microseconds, nanoseconds, pico... in order to catch up.

  Trond


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] NFS: Add acreg{min,max} and acdir{min,max} in milliseconds
       [not found]                         ` <1244846673.32257.69.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
@ 2009-06-15 22:53                           ` Amit Gud
  2009-06-15 23:08                             ` [PATCH] NFS: Add acreg{min,max} and acdir{min, max} " NeilBrown
  0 siblings, 1 reply; 15+ messages in thread
From: Amit Gud @ 2009-06-15 22:53 UTC (permalink / raw)
  To: Trond Myklebust
  Cc: linux-nfs, Steve Dickson, gud-OYTqUY/oFF8, Uhlenkott, Jason

Trond Myklebust wrote:
> It boils down to this: I'm extremely reluctant to get into an arms race
> of adding ever more mount options for increasingly finer-tuned attribute
> cache timeouts. While such an option may meet _your_ machine room
> requirements here and now, it becomes tiresome over the years as
> machines gain power, and people first start lobbying for millisecond
> timeouts, then microseconds, nanoseconds, pico... in order to catch up.
> 

It only makes sense to make machines more powerful and put that power to
optimum use. If keeping up with increased resolution is an issue, you
think something like "-o unit=ms acregmin=..." would be better? 'unit'
can apply to all the time related options defaulting to seconds.


AG
-- 
May the source be with you.
http://cis.ksu.edu/~gud

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] NFS: Add acreg{min,max} and acdir{min, max} in milliseconds
  2009-06-15 22:53                           ` Amit Gud
@ 2009-06-15 23:08                             ` NeilBrown
       [not found]                               ` <3786d1f06aae533fa82740d68985fd50.squirrel-eq65iwfR9nKIECXXMXunQA@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: NeilBrown @ 2009-06-15 23:08 UTC (permalink / raw)
  To: Amit Gud
  Cc: Trond Myklebust, linux-nfs, Steve Dickson, gud-OYTqUY/oFF8,
	Uhlenkott, Jason

On Tue, June 16, 2009 8:53 am, Amit Gud wrote:
> Trond Myklebust wrote:
>> It boils down to this: I'm extremely reluctant to get into an arms race
>> of adding ever more mount options for increasingly finer-tuned attribute
>> cache timeouts. While such an option may meet _your_ machine room
>> requirements here and now, it becomes tiresome over the years as
>> machines gain power, and people first start lobbying for millisecond
>> timeouts, then microseconds, nanoseconds, pico... in order to catch up.
>>
>
> It only makes sense to make machines more powerful and put that power to
> optimum use. If keeping up with increased resolution is an issue, you
> think something like "-o unit=ms acregmin=..." would be better? 'unit'
> can apply to all the time related options defaulting to seconds.

Wasn't this problem solved hundreds of years ago by the invention
of the decimal point :-)

  -o acregmin=0.0012

Write the code to use as much precision as makes sense given the value
of HZ - and round up.  No new mount options.

NeilBrown


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] NFS: Add acreg{min,max} and acdir{min, max} in milliseconds
       [not found]                               ` <3786d1f06aae533fa82740d68985fd50.squirrel-eq65iwfR9nKIECXXMXunQA@public.gmane.org>
@ 2009-06-15 23:19                                 ` Trond Myklebust
       [not found]                                   ` <1245107980.7470.0.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Trond Myklebust @ 2009-06-15 23:19 UTC (permalink / raw)
  To: NeilBrown
  Cc: Amit Gud, linux-nfs, Steve Dickson, gud-OYTqUY/oFF8, Uhlenkott, Jason

On Tue, 2009-06-16 at 09:08 +1000, NeilBrown wrote:
> On Tue, June 16, 2009 8:53 am, Amit Gud wrote:
> > Trond Myklebust wrote:
> >> It boils down to this: I'm extremely reluctant to get into an arms race
> >> of adding ever more mount options for increasingly finer-tuned attribute
> >> cache timeouts. While such an option may meet _your_ machine room
> >> requirements here and now, it becomes tiresome over the years as
> >> machines gain power, and people first start lobbying for millisecond
> >> timeouts, then microseconds, nanoseconds, pico... in order to catch up.
> >>
> >
> > It only makes sense to make machines more powerful and put that power to
> > optimum use. If keeping up with increased resolution is an issue, you
> > think something like "-o unit=ms acregmin=..." would be better? 'unit'
> > can apply to all the time related options defaulting to seconds.
> 
> Wasn't this problem solved hundreds of years ago by the invention
> of the decimal point :-)
> 
>   -o acregmin=0.0012
> 
> Write the code to use as much precision as makes sense given the value
> of HZ - and round up.  No new mount options.

That works for me...

Trond


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] NFS: Add acreg{min,max} and acdir{min, max} in milliseconds
       [not found]                                   ` <1245107980.7470.0.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
@ 2009-06-16 16:30                                     ` Steve Dickson
  2009-06-17 10:37                                       ` Neil Brown
  0 siblings, 1 reply; 15+ messages in thread
From: Steve Dickson @ 2009-06-16 16:30 UTC (permalink / raw)
  To: Trond Myklebust
  Cc: NeilBrown, Amit Gud, linux-nfs, gud-OYTqUY/oFF8, Uhlenkott, Jason



Trond Myklebust wrote:
> On Tue, 2009-06-16 at 09:08 +1000, NeilBrown wrote:
>> On Tue, June 16, 2009 8:53 am, Amit Gud wrote:
>>> Trond Myklebust wrote:
>>>> It boils down to this: I'm extremely reluctant to get into an arms race
>>>> of adding ever more mount options for increasingly finer-tuned attribute
>>>> cache timeouts. While such an option may meet _your_ machine room
>>>> requirements here and now, it becomes tiresome over the years as
>>>> machines gain power, and people first start lobbying for millisecond
>>>> timeouts, then microseconds, nanoseconds, pico... in order to catch up.
>>>>
>>> It only makes sense to make machines more powerful and put that power to
>>> optimum use. If keeping up with increased resolution is an issue, you
>>> think something like "-o unit=ms acregmin=..." would be better? 'unit'
>>> can apply to all the time related options defaulting to seconds.
>> Wasn't this problem solved hundreds of years ago by the invention
>> of the decimal point :-)
>>
>>   -o acregmin=0.0012
>>
>> Write the code to use as much precision as makes sense given the value
>> of HZ - and round up.  No new mount options.
> 
> That works for me...
Or better how about -o acregmin=12micro

steved
> 
> Trond
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] NFS: Add acreg{min,max} and acdir{min, max} in milliseconds
  2009-06-16 16:30                                     ` Steve Dickson
@ 2009-06-17 10:37                                       ` Neil Brown
  0 siblings, 0 replies; 15+ messages in thread
From: Neil Brown @ 2009-06-17 10:37 UTC (permalink / raw)
  To: Steve Dickson
  Cc: Trond Myklebust, Amit Gud, linux-nfs, gud-OYTqUY/oFF8, Uhlenkott, Jason

On Tuesday June 16, SteveD@redhat.com wrote:
> >> Wasn't this problem solved hundreds of years ago by the invention
> >> of the decimal point :-)
> >>
> >>   -o acregmin=0.0012
> >>
> >> Write the code to use as much precision as makes sense given the value
> >> of HZ - and round up.  No new mount options.
> > 
> > That works for me...
> Or better how about -o acregmin=12micro

How can you consider that to be better?
I might almost consider "12usec" a little better as it makes the unit
explicit, and it is a fairly standard abbreviation.  But I've never
seen "micro" as a suffix before.

NeilBrown

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-06-17 10:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-10  1:32 [PATCH] NFS: Add acreg{min,max} and acdir{min,max} in milliseconds Amit Gud
2009-06-10 12:27 ` Trond Myklebust
     [not found]   ` <1244636844.24750.23.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-06-10 19:43     ` Amit Gud
2009-06-11  0:11       ` Trond Myklebust
2009-06-11 20:24         ` Amit Gud
2009-06-11 21:14           ` Trond Myklebust
     [not found]             ` <1244754888.5047.132.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-06-12 19:30               ` Amit Gud
2009-06-12 19:50                 ` Trond Myklebust
     [not found]                   ` <1244836259.19533.19.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-06-12 21:49                     ` Amit Gud
2009-06-12 22:44                       ` Trond Myklebust
     [not found]                         ` <1244846673.32257.69.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-06-15 22:53                           ` Amit Gud
2009-06-15 23:08                             ` [PATCH] NFS: Add acreg{min,max} and acdir{min, max} " NeilBrown
     [not found]                               ` <3786d1f06aae533fa82740d68985fd50.squirrel-eq65iwfR9nKIECXXMXunQA@public.gmane.org>
2009-06-15 23:19                                 ` Trond Myklebust
     [not found]                                   ` <1245107980.7470.0.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-06-16 16:30                                     ` Steve Dickson
2009-06-17 10:37                                       ` Neil Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.