Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Linus Torvalds
On Thu, Sep 5, 2013 at 7:01 PM, Waiman Long wrote: > > I am sorry that I misunderstand what you said. I will do what you and Al > advise me to do. I'm sorry I shouted at you. I was getting a bit frustrated there.. Linus -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Waiman Long
On 09/05/2013 04:42 PM, Linus Torvalds wrote: On Thu, Sep 5, 2013 at 1:29 PM, Waiman Long wrote: It is not as simple as doing a strncpy(). Yes it damn well is. Stop the f*cking stupid arguments, and instead listen to what I say. Here. Let me bold-face the most important part for you, so

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Linus Torvalds
On Thu, Sep 5, 2013 at 1:46 PM, Al Viro wrote: > > static int prepend_name(char **buffer, int *buflen, struct qstr *name) > { > const char *s = ACCESS_ONCE(name->name); > unsigned len = ACCESS_ONCE(name->len); > char *p; > > *buflen -= len; > if (*buflen <

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Al Viro
On Thu, Sep 05, 2013 at 04:29:06PM -0400, Waiman Long wrote: > It is not as simple as doing a strncpy(). The pathname was built > from the leaf up to the root, and from the end of buffer toward the > beginning. As it goes through the while loop, the buffer will look > like: > > "/c" > "

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Linus Torvalds
On Thu, Sep 5, 2013 at 1:29 PM, Waiman Long wrote: > > It is not as simple as doing a strncpy(). Yes it damn well is. Stop the f*cking stupid arguments, and instead listen to what I say. Here. Let me bold-face the most important part for you, so that you don't miss it in all the other crap:

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Waiman Long
On 09/05/2013 04:04 PM, Al Viro wrote: On Thu, Sep 05, 2013 at 02:55:16PM -0400, Waiman Long wrote: + const char *dname = ACCESS_ONCE(dentry->d_name.name); + u32 dlen = dentry->d_name.len; + int error; + + if (likely(dname == (const char *)dentry->d_iname)) { +

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Waiman Long
On 09/05/2013 03:35 PM, Linus Torvalds wrote: No. Stop all these stupid games. No d_lock, no trying to make d_name/d_len consistent. No "compare d_name against d_iname". No EINVAL. No idiotic racy "let's fetch each byte one-by one and test them against NUL", which is just racy and stupid.

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Al Viro
On Thu, Sep 05, 2013 at 02:55:16PM -0400, Waiman Long wrote: > + const char *dname = ACCESS_ONCE(dentry->d_name.name); > + u32 dlen = dentry->d_name.len; > + int error; > + > + if (likely(dname == (const char *)dentry->d_iname)) { > + /* > + * Internal

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Linus Torvalds
On Thu, Sep 5, 2013 at 11:55 AM, Waiman Long wrote: > +static int prepend_name(char **buffer, int *buflen, struct dentry *dentry) > { > - return prepend(buffer, buflen, name->name, name->len); > + /* > +* With RCU path tracing, it may race with rename. Use > +*

[PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Waiman Long
When running the AIM7's short workload, Linus' lockref patch eliminated most of the spinlock contention. However, there were still some left: 8.46% reaim [kernel.kallsyms] [k] _raw_spin_lock |--42.21%-- d_path | proc_pid_readlink

[PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Waiman Long
When running the AIM7's short workload, Linus' lockref patch eliminated most of the spinlock contention. However, there were still some left: 8.46% reaim [kernel.kallsyms] [k] _raw_spin_lock |--42.21%-- d_path | proc_pid_readlink

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Linus Torvalds
On Thu, Sep 5, 2013 at 11:55 AM, Waiman Long waiman.l...@hp.com wrote: +static int prepend_name(char **buffer, int *buflen, struct dentry *dentry) { - return prepend(buffer, buflen, name-name, name-len); + /* +* With RCU path tracing, it may race with rename. Use +

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Al Viro
On Thu, Sep 05, 2013 at 02:55:16PM -0400, Waiman Long wrote: + const char *dname = ACCESS_ONCE(dentry-d_name.name); + u32 dlen = dentry-d_name.len; + int error; + + if (likely(dname == (const char *)dentry-d_iname)) { + /* + * Internal dname, the

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Waiman Long
On 09/05/2013 03:35 PM, Linus Torvalds wrote: No. Stop all these stupid games. No d_lock, no trying to make d_name/d_len consistent. No compare d_name against d_iname. No EINVAL. No idiotic racy let's fetch each byte one-by one and test them against NUL, which is just racy and stupid. Just

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Waiman Long
On 09/05/2013 04:04 PM, Al Viro wrote: On Thu, Sep 05, 2013 at 02:55:16PM -0400, Waiman Long wrote: + const char *dname = ACCESS_ONCE(dentry-d_name.name); + u32 dlen = dentry-d_name.len; + int error; + + if (likely(dname == (const char *)dentry-d_iname)) { +

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Al Viro
On Thu, Sep 05, 2013 at 04:29:06PM -0400, Waiman Long wrote: It is not as simple as doing a strncpy(). The pathname was built from the leaf up to the root, and from the end of buffer toward the beginning. As it goes through the while loop, the buffer will look like: /c /b/c /a/b/c

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Linus Torvalds
On Thu, Sep 5, 2013 at 1:29 PM, Waiman Long waiman.l...@hp.com wrote: It is not as simple as doing a strncpy(). Yes it damn well is. Stop the f*cking stupid arguments, and instead listen to what I say. Here. Let me bold-face the most important part for you, so that you don't miss it in all

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Linus Torvalds
On Thu, Sep 5, 2013 at 1:46 PM, Al Viro v...@zeniv.linux.org.uk wrote: static int prepend_name(char **buffer, int *buflen, struct qstr *name) { const char *s = ACCESS_ONCE(name-name); unsigned len = ACCESS_ONCE(name-len); char *p; *buflen -= len; if

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Waiman Long
On 09/05/2013 04:42 PM, Linus Torvalds wrote: On Thu, Sep 5, 2013 at 1:29 PM, Waiman Longwaiman.l...@hp.com wrote: It is not as simple as doing a strncpy(). Yes it damn well is. Stop the f*cking stupid arguments, and instead listen to what I say. Here. Let me bold-face the most important

Re: [PATCH v2 1/1] dcache: Translating dentry into pathname without taking rename_lock

2013-09-05 Thread Linus Torvalds
On Thu, Sep 5, 2013 at 7:01 PM, Waiman Long waiman.l...@hp.com wrote: I am sorry that I misunderstand what you said. I will do what you and Al advise me to do. I'm sorry I shouted at you. I was getting a bit frustrated there.. Linus -- To unsubscribe from this list: send the line