Re: [PATCH] epoll: avoid calling ep_call_nested() from ep_poll_safewake()

2018-01-18 Thread Hou Tao
Hi Jason, On 2017/10/18 22:03, Jason Baron wrote: > > > On 10/17/2017 11:37 AM, Davidlohr Bueso wrote: >> On Fri, 13 Oct 2017, Jason Baron wrote: >> >>> The ep_poll_safewake() function is used to wakeup potentially nested >>> epoll >>> file descriptors. The function uses ep_call_nested() to

Re: [PATCH] epoll: avoid calling ep_call_nested() from ep_poll_safewake()

2018-01-18 Thread Hou Tao
Hi Jason, On 2017/10/18 22:03, Jason Baron wrote: > > > On 10/17/2017 11:37 AM, Davidlohr Bueso wrote: >> On Fri, 13 Oct 2017, Jason Baron wrote: >> >>> The ep_poll_safewake() function is used to wakeup potentially nested >>> epoll >>> file descriptors. The function uses ep_call_nested() to

Re: [RFC][PATCH 1/8] epoll: remove epmutex from ep_free() & eventpoll_release_file()

2017-10-30 Thread Hou Tao
Hi, On 2017/10/28 21:58, Davidlohr Bueso wrote: > On Sat, 28 Oct 2017, Hou Tao wrote: > >> Remove the global epmutex from ep_free() and eventpoll_release_file(). >> In the later patches, we will add locks with a smaller granularity >> to serve the same purposes of e

Re: [RFC][PATCH 1/8] epoll: remove epmutex from ep_free() & eventpoll_release_file()

2017-10-30 Thread Hou Tao
Hi, On 2017/10/28 21:58, Davidlohr Bueso wrote: > On Sat, 28 Oct 2017, Hou Tao wrote: > >> Remove the global epmutex from ep_free() and eventpoll_release_file(). >> In the later patches, we will add locks with a smaller granularity >> to serve the same purposes of e

[RFC][PATCH 5/8] epoll: iterate epi in file->f_ep_links by using list_first_or_null_rcu

2017-10-28 Thread Hou Tao
When eventpoll_release_file() iterates epitem in file->f_ep_links, the epitem may be removed by ep_free(). To protect again the concurrent writer, iterate file->f_ep_links by using rcu_read_lock() and list_first_or_null_rcu() Signed-off-by: Hou Tao <hout...@huawei.com> --- fs/even

[RFC][PATCH 5/8] epoll: iterate epi in file->f_ep_links by using list_first_or_null_rcu

2017-10-28 Thread Hou Tao
When eventpoll_release_file() iterates epitem in file->f_ep_links, the epitem may be removed by ep_free(). To protect again the concurrent writer, iterate file->f_ep_links by using rcu_read_lock() and list_first_or_null_rcu() Signed-off-by: Hou Tao --- fs/eventpoll.c | 12 +++-

[RFC][PATCH 3/8] epoll: remove file from tfile_check_list when releasing file

2017-10-28 Thread Hou Tao
. Signed-off-by: Hou Tao <hout...@huawei.com> --- fs/eventpoll.c | 12 1 file changed, 12 insertions(+) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 44ea587..998c635 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1029,6 +1029,18 @@ void eventpoll_release_file(struc

[RFC][PATCH 3/8] epoll: remove file from tfile_check_list when releasing file

2017-10-28 Thread Hou Tao
. Signed-off-by: Hou Tao --- fs/eventpoll.c | 12 1 file changed, 12 insertions(+) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 44ea587..998c635 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1029,6 +1029,18 @@ void eventpoll_release_file(struct file *file

[RFC][PATCH 8/8] epoll: protect the iteration of ep->rbr by ep->mtx in ep_free()

2017-10-28 Thread Hou Tao
When ep_free() iterates the epi in ep->rbr, the epi may be removed by eventpoll_release_file(). To protect again the case, acquiring ep->mtx before the iteration of ep->rbr. Signed-off-by: Hou Tao <hout...@huawei.com> --- fs/eventpoll.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[RFC][PATCH 0/8] epoll: remove epmutex from ep_free() and eventpoll_release_file() for non-nested case

2017-10-28 Thread Hou Tao
ch 8 enlarge the protected region of ep->mtx to protect against the iteration of ep->rbr. The patch set has passed the epoll related test cases in LTP, and we are planing to run some torture or performance test cases for nested-epoll cases. Comments and questions are welcome. Regards, Tao --- Hou Tao

[RFC][PATCH 8/8] epoll: protect the iteration of ep->rbr by ep->mtx in ep_free()

2017-10-28 Thread Hou Tao
When ep_free() iterates the epi in ep->rbr, the epi may be removed by eventpoll_release_file(). To protect again the case, acquiring ep->mtx before the iteration of ep->rbr. Signed-off-by: Hou Tao --- fs/eventpoll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -

[RFC][PATCH 0/8] epoll: remove epmutex from ep_free() and eventpoll_release_file() for non-nested case

2017-10-28 Thread Hou Tao
ch 8 enlarge the protected region of ep->mtx to protect against the iteration of ep->rbr. The patch set has passed the epoll related test cases in LTP, and we are planing to run some torture or performance test cases for nested-epoll cases. Comments and questions are welcome. Regards, Tao --- Hou Tao

[RFC][PATCH 2/8] epoll: remove ep from visited_list when freeing ep

2017-10-28 Thread Hou Tao
added to the visited_list, we need to wait for its removal. Signed-off-by: Hou Tao <hout...@huawei.com> --- fs/eventpoll.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 26ab0c5..44ea587 100644 --- a/fs/eventpoll.c ++

[RFC][PATCH 6/8] epoll: ensure the validity of ep when removing epi in eventpoll_release_file()

2017-10-28 Thread Hou Tao
needs to acquire ep->mtx which is a mutex, so we add a ref-counter to eventpoll and increase it before leaving the rcu read critical region. Signed-off-by: Hou Tao <hout...@huawei.com> --- fs/eventpoll.c | 38 +++--- 1 file changed, 31 insertions(+), 7 deletions

[RFC][PATCH 7/8] epoll: prevent the double-free of epi in eventpoll_release_file()

2017-10-28 Thread Hou Tao
ay has already got the epi from file->f_ep_links. To protect against the double-free case, check rb_first_cached() in eventpoll_release_file() to ensure the epi has not been removed by ep_free() Signed-off-by: Hou Tao <hout...@huawei.com> --- fs/eventpoll.c | 13 +++--

[RFC][PATCH 2/8] epoll: remove ep from visited_list when freeing ep

2017-10-28 Thread Hou Tao
added to the visited_list, we need to wait for its removal. Signed-off-by: Hou Tao --- fs/eventpoll.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 26ab0c5..44ea587 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -862,6

[RFC][PATCH 6/8] epoll: ensure the validity of ep when removing epi in eventpoll_release_file()

2017-10-28 Thread Hou Tao
needs to acquire ep->mtx which is a mutex, so we add a ref-counter to eventpoll and increase it before leaving the rcu read critical region. Signed-off-by: Hou Tao --- fs/eventpoll.c | 38 +++--- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/fs/eventpo

[RFC][PATCH 7/8] epoll: prevent the double-free of epi in eventpoll_release_file()

2017-10-28 Thread Hou Tao
ay has already got the epi from file->f_ep_links. To protect against the double-free case, check rb_first_cached() in eventpoll_release_file() to ensure the epi has not been removed by ep_free() Signed-off-by: Hou Tao --- fs/eventpoll.c | 13 +++-- 1 file changed, 11 inserti

[RFC][PATCH 1/8] epoll: remove epmutex from ep_free() & eventpoll_release_file()

2017-10-28 Thread Hou Tao
Remove the global epmutex from ep_free() and eventpoll_release_file(). In the later patches, we will add locks with a smaller granularity to serve the same purposes of epmutex. Signed-off-by: Hou Tao <hout...@huawei.com> --- fs/eventpoll.c | 4 1 file changed, 4 deletions(-) diff

[RFC][PATCH 4/8] epoll: free eventpoll by rcu to provide existence guarantee

2017-10-28 Thread Hou Tao
struct belongs to an epoll fd which also polls the target file. So freeing eventpoll by rcu to ensure the accessed fields of eventpoll are still valid when invoking reverse_path_check_proc(). Signed-off-by: Hou Tao <hout...@huawei.com> --- fs/eventpoll.c | 12 +++- 1 file changed, 1

[RFC][PATCH 1/8] epoll: remove epmutex from ep_free() & eventpoll_release_file()

2017-10-28 Thread Hou Tao
Remove the global epmutex from ep_free() and eventpoll_release_file(). In the later patches, we will add locks with a smaller granularity to serve the same purposes of epmutex. Signed-off-by: Hou Tao --- fs/eventpoll.c | 4 1 file changed, 4 deletions(-) diff --git a/fs/eventpoll.c b/fs

[RFC][PATCH 4/8] epoll: free eventpoll by rcu to provide existence guarantee

2017-10-28 Thread Hou Tao
struct belongs to an epoll fd which also polls the target file. So freeing eventpoll by rcu to ensure the accessed fields of eventpoll are still valid when invoking reverse_path_check_proc(). Signed-off-by: Hou Tao --- fs/eventpoll.c | 12 +++- 1 file changed, 11 insertions(+), 1 de

[PATCH] NFS: always treat the invocation of nfs_getattr as cache hit when noac is on

2017-04-28 Thread Hou Tao
. To prevent the unnecessary RPCs, we need to check whether or not the noac option is used, and always report the invocation of nfs_getattr() as cache hit instead cache miss when it's on. Signed-off-by: Hou Tao <hout...@huawei.com> --- fs/nfs/inode.c | 5 - 1 file changed, 4 insertions(+), 1 de

[PATCH] NFS: always treat the invocation of nfs_getattr as cache hit when noac is on

2017-04-28 Thread Hou Tao
. To prevent the unnecessary RPCs, we need to check whether or not the noac option is used, and always report the invocation of nfs_getattr() as cache hit instead cache miss when it's on. Signed-off-by: Hou Tao --- fs/nfs/inode.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs

Re: [RFC][PATCH] proc: invalidate the deleting or deleted proc dentry

2017-04-23 Thread Hou Tao
Hi, any comment ? On 2017/4/13 21:49, Hou Tao wrote: > After the invocation of remove_proc_entry() for a proc fs directory, > if the related dentry had been held by some processes (eg., by chdir), > the lookup afterwards will still return the old proc_dir_entry. The > new created p

Re: [RFC][PATCH] proc: invalidate the deleting or deleted proc dentry

2017-04-23 Thread Hou Tao
Hi, any comment ? On 2017/4/13 21:49, Hou Tao wrote: > After the invocation of remove_proc_entry() for a proc fs directory, > if the related dentry had been held by some processes (eg., by chdir), > the lookup afterwards will still return the old proc_dir_entry. The > new created p

[RFC][PATCH] proc: invalidate the deleting or deleted proc dentry

2017-04-13 Thread Hou Tao
-by: Hou Tao <hout...@huawei.com> --- fs/proc/generic.c | 21 - fs/proc/inode.c| 5 + fs/proc/internal.h | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/fs/proc/generic.c b/fs/proc/generic.c index ee27feb..92c9dd4 100644 --- a/fs/proc/gen

[RFC][PATCH] proc: invalidate the deleting or deleted proc dentry

2017-04-13 Thread Hou Tao
-by: Hou Tao --- fs/proc/generic.c | 21 - fs/proc/inode.c| 5 + fs/proc/internal.h | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/fs/proc/generic.c b/fs/proc/generic.c index ee27feb..92c9dd4 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c

Re: cfq-iosched: two questions about the hrtimer version of CFQ

2017-03-06 Thread Hou Tao
Sorry for the resend, please refer to the later one. On 2017/3/6 21:50, Hou Tao wrote: > Hi Jan and list, > > When testing the hrtimer version of CFQ, we found a performance degradation > problem which seems to be caused by commit 0b31c10 ("cfq-iosched: Charge at > least 1 ji

Re: cfq-iosched: two questions about the hrtimer version of CFQ

2017-03-06 Thread Hou Tao
Sorry for the resend, please refer to the later one. On 2017/3/6 21:50, Hou Tao wrote: > Hi Jan and list, > > When testing the hrtimer version of CFQ, we found a performance degradation > problem which seems to be caused by commit 0b31c10 ("cfq-iosched: Charge at > least 1 ji

cfq-iosched: two questions about the hrtimer version of CFQ

2017-03-06 Thread Hou Tao
Hi Jan and list, When testing the hrtimer version of CFQ, we found a performance degradation problem which seems to be caused by commit 0b31c10 ("cfq-iosched: Charge at least 1 jiffie instead of 1 ns"). The following is the test process: * filesystem and block device * XFS + /dev/sda

cfq-iosched: two questions about the hrtimer version of CFQ

2017-03-06 Thread Hou Tao
Hi Jan and list, When testing the hrtimer version of CFQ, we found a performance degradation problem which seems to be caused by commit 0b31c10 ("cfq-iosched: Charge at least 1 jiffie instead of 1 ns"). The following is the test process: * filesystem and block device * XFS + /dev/sda

cfq-iosched: two questions about the hrtimer version of CFQ

2017-03-06 Thread Hou Tao
Hi Jan and list, When testing the hrtimer version of CFQ, we found a performance degradation problem which seems to be caused by commit 0b31c10 ("cfq-iosched: Charge at least 1 jiffie instead of 1 ns"). The following is the test process: * filesystem and block device * XFS + /dev/sda

cfq-iosched: two questions about the hrtimer version of CFQ

2017-03-06 Thread Hou Tao
Hi Jan and list, When testing the hrtimer version of CFQ, we found a performance degradation problem which seems to be caused by commit 0b31c10 ("cfq-iosched: Charge at least 1 jiffie instead of 1 ns"). The following is the test process: * filesystem and block device * XFS + /dev/sda

[PATCH] scripts/tags.sh: include arch/Kconfig* for tags generation

2017-02-04 Thread Hou Tao
Kconfig files under arch/ directory are ignored by all_kconfigs(), so include them for tags generation. Signed-off-by: Hou Tao <hout...@huawei.com> --- scripts/tags.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/tags.sh b/scripts/tags.sh index df5fa77..d661f2f

[PATCH] scripts/tags.sh: include arch/Kconfig* for tags generation

2017-02-04 Thread Hou Tao
Kconfig files under arch/ directory are ignored by all_kconfigs(), so include them for tags generation. Signed-off-by: Hou Tao --- scripts/tags.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/tags.sh b/scripts/tags.sh index df5fa77..d661f2f 100755 --- a/scripts/tags.sh +++ b

[PATCH] blk-throttle: fix infinite throttling caused by non-cascading timer wheel

2016-09-12 Thread Hou Tao
s OK to renew the time slice. 2. If there is no queued bio, the time slice must have been expired, so it's Ok to renew the time slice. Signed-off-by: Hou Tao <hout...@huawei.com> --- block/blk-throttle.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/block/blk

[PATCH] blk-throttle: fix infinite throttling caused by non-cascading timer wheel

2016-09-12 Thread Hou Tao
s OK to renew the time slice. 2. If there is no queued bio, the time slice must have been expired, so it's Ok to renew the time slice. Signed-off-by: Hou Tao --- block/blk-throttle.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-thr

[PATCH] block-throttle: fix throtl_log for throttled-bios dispatch

2016-09-10 Thread Hou Tao
queued=1/0 throtl /1 dispatch queued=2/0 .. throtl /1 dispatch disp=1 Signed-off-by: Hou Tao <hout...@huawei.com> --- block/blk-throttle.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 47a3

[PATCH] block-throttle: fix throtl_log for throttled-bios dispatch

2016-09-10 Thread Hou Tao
queued=1/0 throtl /1 dispatch queued=2/0 .. throtl /1 dispatch disp=1 Signed-off-by: Hou Tao --- block/blk-throttle.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 47a3e54..c724c97 100644 --- a/blo

<    1   2