[PATCH] ib_srp: Let compiler ignore the useless debug code

2017-02-24 Thread Minfei Huang
"if (0)" is used to make this block of debug code not be executed. There is a more elegant way to let compiler ignore this code, using "#if 0 .. #endif" instead. Although it may be optimised by some compilers with specified parameter, just for readable. Signed-off-by

[PATCH] ib_srp: Let compiler ignore the useless debug code

2017-02-24 Thread Minfei Huang
"if (0)" is used to make this block of debug code not be executed. There is a more elegant way to let compiler ignore this code, using "#if 0 .. #endif" instead. Although it may be optimised by some compilers with specified parameter, just for readable. Signed-off-by: Minfei

Re: [PATCH] dm: Return correct value in retry loop

2016-09-11 Thread Minfei Huang
Ping. Any comment is appreciate. Thanks Minfei On 09/06/16 at 04:00P, Minfei Huang wrote: > dm_resume will return sliently in retry loop's failure. Assign a correct > return value in the failed loop. > > Remove a useless assignment as well. > > Signed-off-by: Minfei Huang

Re: [PATCH] dm: Return correct value in retry loop

2016-09-11 Thread Minfei Huang
Ping. Any comment is appreciate. Thanks Minfei On 09/06/16 at 04:00P, Minfei Huang wrote: > dm_resume will return sliently in retry loop's failure. Assign a correct > return value in the failed loop. > > Remove a useless assignment as well. > > Signed-off-by: Minfei Huang &

[PATCH] dm: Return correct value in retry loop

2016-09-06 Thread Minfei Huang
dm_resume will return sliently in retry loop's failure. Assign a correct return value in the failed loop. Remove a useless assignment as well. Signed-off-by: Minfei Huang <mngh...@gmail.com> --- drivers/md/dm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/driv

[PATCH] dm: Return correct value in retry loop

2016-09-06 Thread Minfei Huang
dm_resume will return sliently in retry loop's failure. Assign a correct return value in the failed loop. Remove a useless assignment as well. Signed-off-by: Minfei Huang --- drivers/md/dm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md

[PATCH RESEND] virtio_blk: Fix a slient kernel panic

2016-08-09 Thread Minfei Huang
should take care of allocation failure, and return correct value to let caller know what happen. Tested-by: Chao Fan <fanc.f...@cn.fujitsu.com> Signed-off-by: Minfei Huang <mngh...@gmail.com> Signed-off-by: Minfei Huang <minfei@alibaba-inc.com> Reviewed-by: Corneli

[PATCH RESEND] virtio_blk: Fix a slient kernel panic

2016-08-09 Thread Minfei Huang
should take care of allocation failure, and return correct value to let caller know what happen. Tested-by: Chao Fan Signed-off-by: Minfei Huang Signed-off-by: Minfei Huang Reviewed-by: Cornelia Huck Reviewed-by: Stefan Hajnoczi --- drivers/block/virtio_blk.c | 26 -- 1

Re: [PATCH v3] virtio_blk: Fix a slient kernel panic

2016-08-03 Thread Minfei Huang
Hi, Michael. Since Stefan and Cornelia have review-acked this patch, could you mind helping review this patch? Thanks Minfei > On Jul 29, 2016, at 16:26, Stefan Hajnoczi <stefa...@gmail.com> wrote: > > On Tue, Jul 19, 2016 at 5:32 AM, Minfei Huang <mnfhu...@gmail.com> w

Re: [PATCH v3] virtio_blk: Fix a slient kernel panic

2016-08-03 Thread Minfei Huang
Hi, Michael. Since Stefan and Cornelia have review-acked this patch, could you mind helping review this patch? Thanks Minfei > On Jul 29, 2016, at 16:26, Stefan Hajnoczi wrote: > > On Tue, Jul 19, 2016 at 5:32 AM, Minfei Huang wrote: >> From: Minfei Huang >> >

Re: [lkp] [blk] ee5c4fef9f: BUG: unable to handle kernel NULL pointer dereference at 0000010b

2016-07-29 Thread Minfei Huang
t; FYI, we noticed the following commit: > > https://github.com/0day-ci/linux > Minfei-Huang/blk-core-Fix-the-bad-IO-during-checking-bio/20160728-182758 > commit ee5c4fef9f2ef03ee8f283a5b24192df00e17f0f ("blk-core: Fix the bad IO > during checking bio") > > in te

Re: [lkp] [blk] ee5c4fef9f: BUG: unable to handle kernel NULL pointer dereference at 0000010b

2016-07-29 Thread Minfei Huang
owing commit: > > https://github.com/0day-ci/linux > Minfei-Huang/blk-core-Fix-the-bad-IO-during-checking-bio/20160728-182758 > commit ee5c4fef9f2ef03ee8f283a5b24192df00e17f0f ("blk-core: Fix the bad IO > during checking bio") > > in testcase: boot > > on tes

[PATCH] blk-core: Fix the bad IO during checking bio

2016-07-28 Thread Minfei Huang
We will handle IO as a bad IO, if its range exceeds the disk's capacity in function bio_check_eod. Also we should catch the corner case if inode->i_size is set to 0 during disabling disk. Fix the coming IO as a bad IO as well, if inode->i_size is set to 0. Signed-off-by: Minfei Huang

[PATCH] blk-core: Fix the bad IO during checking bio

2016-07-28 Thread Minfei Huang
We will handle IO as a bad IO, if its range exceeds the disk's capacity in function bio_check_eod. Also we should catch the corner case if inode->i_size is set to 0 during disabling disk. Fix the coming IO as a bad IO as well, if inode->i_size is set to 0. Signed-off-by: Minfei Huang Sign

Re: [PATCH v3] virtio_blk: Fix a slient kernel panic

2016-07-22 Thread Minfei Huang
Ping, Any comment is appreciate. Thanks Minfei > On Jul 19, 2016, at 20:22, Cornelia Huck <cornelia.h...@de.ibm.com> wrote: > > On Tue, 19 Jul 2016 12:32:42 +0800 > Minfei Huang <mnfhu...@gmail.com> wrote: > >> From: Minfei Huang <mngh...@gmail.com>

Re: [PATCH v3] virtio_blk: Fix a slient kernel panic

2016-07-22 Thread Minfei Huang
Ping, Any comment is appreciate. Thanks Minfei > On Jul 19, 2016, at 20:22, Cornelia Huck wrote: > > On Tue, 19 Jul 2016 12:32:42 +0800 > Minfei Huang wrote: > >> From: Minfei Huang >> >> We do a lot of memory allocation in function init_vq, and don't

[PATCH v3] virtio_blk: Fix a slient kernel panic

2016-07-18 Thread Minfei Huang
From: Minfei Huang <mngh...@gmail.com> We do a lot of memory allocation in function init_vq, and don't handle the allocation failure properly. Then this function will return 0, although initialization fails due to lacking memory. At that moment, kernel will panic in guest machine, if

[PATCH v3] virtio_blk: Fix a slient kernel panic

2016-07-18 Thread Minfei Huang
From: Minfei Huang We do a lot of memory allocation in function init_vq, and don't handle the allocation failure properly. Then this function will return 0, although initialization fails due to lacking memory. At that moment, kernel will panic in guest machine, if virtio is used to drive disk

Re: [PATCH v2] virtio_blk: Fix a slient kernel panic

2016-07-18 Thread Minfei Huang
On 07/18/16 at 06:25P, Cornelia Huck wrote: > On Tue, 19 Jul 2016 00:18:32 +0800 > Minfei Huang <mnfhu...@gmail.com> wrote: > > > On 07/18/16 at 05:21P, Cornelia Huck wrote: > > > On Mon, 18 Jul 2016 22:01:29 +0800 > > > Minfei Huang <mnfhu...@gmail.com&

Re: [PATCH v2] virtio_blk: Fix a slient kernel panic

2016-07-18 Thread Minfei Huang
On 07/18/16 at 06:25P, Cornelia Huck wrote: > On Tue, 19 Jul 2016 00:18:32 +0800 > Minfei Huang wrote: > > > On 07/18/16 at 05:21P, Cornelia Huck wrote: > > > On Mon, 18 Jul 2016 22:01:29 +0800 > > > Minfei Huang wrote: > > > > diff --git

Re: [PATCH v2] virtio_blk: Fix a slient kernel panic

2016-07-18 Thread Minfei Huang
On 07/18/16 at 05:21P, Cornelia Huck wrote: > On Mon, 18 Jul 2016 22:01:29 +0800 > Minfei Huang <mnfhu...@gmail.com> wrote: > > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c > > index 42758b5..d920512 100644 > > --- a/drivers/block/virtio

Re: [PATCH v2] virtio_blk: Fix a slient kernel panic

2016-07-18 Thread Minfei Huang
On 07/18/16 at 05:21P, Cornelia Huck wrote: > On Mon, 18 Jul 2016 22:01:29 +0800 > Minfei Huang wrote: > > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c > > index 42758b5..d920512 100644 > > --- a/drivers/block/virtio_blk.c > > +++ b/drivers/bl

[PATCH v2] virtio_blk: Fix a slient kernel panic

2016-07-18 Thread Minfei Huang
should take care of allocation failure, and return correct value to let caller know what happen. Tested-by: Chao Fan <fanc.f...@cn.fujitsu.com> Signed-off-by: Minfei Huang <minfei@alibaba-inc.com> Signed-off-by: Minfei Huang <mngh...@gmail.com> --- v1: - Refactor the patch

[PATCH v2] virtio_blk: Fix a slient kernel panic

2016-07-18 Thread Minfei Huang
should take care of allocation failure, and return correct value to let caller know what happen. Tested-by: Chao Fan Signed-off-by: Minfei Huang Signed-off-by: Minfei Huang --- v1: - Refactor the patch to make code more readable --- drivers/block/virtio_blk.c | 32

Re: [PATCH] virtio: Return correct errno for function init_vq's failure

2016-07-13 Thread Minfei Huang
On 07/06/16 at 11:18P, Cornelia Huck wrote: > On Mon, 27 Jun 2016 10:09:18 +0800 > Minfei Huang <mngh...@gmail.com> wrote: > > > The error number -ENOENT or 0 will be returned, if we can not allocate > > more memory in function init_vq. If host can support multiple

Re: [PATCH] virtio: Return correct errno for function init_vq's failure

2016-07-13 Thread Minfei Huang
On 07/06/16 at 11:18P, Cornelia Huck wrote: > On Mon, 27 Jun 2016 10:09:18 +0800 > Minfei Huang wrote: > > > The error number -ENOENT or 0 will be returned, if we can not allocate > > more memory in function init_vq. If host can support multiple virtual > > queue

Re: [PATCH RESENT] dm: Check kthread_run's return value

2016-07-06 Thread Minfei Huang
On 07/06/16 at 09:31P, Mike Snitzer wrote: > On Wed, Jul 06 2016 at 9:27am -0400, > Minfei Huang <mngh...@gmail.com> wrote: > > > On 07/06/16 at 09:16P, Mike Snitzer wrote: > > > On Mon, Jul 04 2016 at 11:25am -0400, > > > Minfei Huang <mngh...@gmail.c

Re: [PATCH RESENT] dm: Check kthread_run's return value

2016-07-06 Thread Minfei Huang
On 07/06/16 at 09:31P, Mike Snitzer wrote: > On Wed, Jul 06 2016 at 9:27am -0400, > Minfei Huang wrote: > > > On 07/06/16 at 09:16P, Mike Snitzer wrote: > > > On Mon, Jul 04 2016 at 11:25am -0400, > > > Minfei Huang wrote: > > > > > >

Re: [PATCH RESENT] dm: Check kthread_run's return value

2016-07-06 Thread Minfei Huang
On 07/06/16 at 09:16P, Mike Snitzer wrote: > On Mon, Jul 04 2016 at 11:25am -0400, > Minfei Huang <mngh...@gmail.com> wrote: > > > kthread function is used to process kthread_work. And there is no return > > value checking during create this thread. Add this che

Re: [PATCH RESENT] dm: Check kthread_run's return value

2016-07-06 Thread Minfei Huang
On 07/06/16 at 09:16P, Mike Snitzer wrote: > On Mon, Jul 04 2016 at 11:25am -0400, > Minfei Huang wrote: > > > kthread function is used to process kthread_work. And there is no return > > value checking during create this thread. Add this checking to fix this > >

[PATCH RESENT] dm: Check kthread_run's return value

2016-07-04 Thread Minfei Huang
kthread function is used to process kthread_work. And there is no return value checking during create this thread. Add this checking to fix this issue. Signed-off-by: Minfei Huang <mngh...@gmail.com> --- drivers/md/dm.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-)

[PATCH RESENT] dm: Check kthread_run's return value

2016-07-04 Thread Minfei Huang
kthread function is used to process kthread_work. And there is no return value checking during create this thread. Add this checking to fix this issue. Signed-off-by: Minfei Huang --- drivers/md/dm.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c

[PATCH] virtio: Return correct errno for function init_vq's failure

2016-06-26 Thread Minfei Huang
value in init_vq. Signed-off-by: Minfei Huang <mngh...@gmail.com> Signed-off-by: Minfei Huang <minfei@alibaba-inc.com> --- drivers/block/virtio_blk.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c i

[PATCH] virtio: Return correct errno for function init_vq's failure

2016-06-26 Thread Minfei Huang
value in init_vq. Signed-off-by: Minfei Huang Signed-off-by: Minfei Huang --- drivers/block/virtio_blk.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 42758b5..40ecb2b 100644 --- a/drivers/block/virtio_blk.c

Re: [PATCH] aio: Cleanup unnecessary test for nr_pages

2016-06-22 Thread Minfei Huang
On 06/20/16 at 03:17P, Al Viro wrote: > On Mon, Jun 20, 2016 at 10:05:45PM +0800, Minfei Huang wrote: > > Ping. Any comment is appreciate. > > > > Thanks > > Minfei > > > > On 06/13/16 at 12:33P, Minfei Huang wrote: > > > The variable

Re: [PATCH] aio: Cleanup unnecessary test for nr_pages

2016-06-22 Thread Minfei Huang
On 06/20/16 at 03:17P, Al Viro wrote: > On Mon, Jun 20, 2016 at 10:05:45PM +0800, Minfei Huang wrote: > > Ping. Any comment is appreciate. > > > > Thanks > > Minfei > > > > On 06/13/16 at 12:33P, Minfei Huang wrote: > > > The variable

[PATCH] dm: Check kthread_run's return value

2016-06-21 Thread Minfei Huang
kthread function is used to process kthread_work. And there is no return value checking during create this thread. Add this checking to fix this issue. Signed-off-by: Minfei Huang <mngh...@gmail.com> Signed-off-by: Minfei Huang <minfei@alibaba-inc.com> --- drivers/md/dm.c | 11 ++

[PATCH] dm: Check kthread_run's return value

2016-06-21 Thread Minfei Huang
kthread function is used to process kthread_work. And there is no return value checking during create this thread. Add this checking to fix this issue. Signed-off-by: Minfei Huang Signed-off-by: Minfei Huang --- drivers/md/dm.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions

Re: [PATCH] aio: Cleanup unnecessary test for nr_pages

2016-06-20 Thread Minfei Huang
Ping. Any comment is appreciate. Thanks Minfei On 06/13/16 at 12:33P, Minfei Huang wrote: > The variable nr_pages is always more than 1, because the size of > structure aio_ring is bigger than 0. So remove unnecessary test for > nr_page. > > Signed-off-by: Minfei Huang <

Re: [PATCH] aio: Cleanup unnecessary test for nr_pages

2016-06-20 Thread Minfei Huang
Ping. Any comment is appreciate. Thanks Minfei On 06/13/16 at 12:33P, Minfei Huang wrote: > The variable nr_pages is always more than 1, because the size of > structure aio_ring is bigger than 0. So remove unnecessary test for > nr_page. > > Signed-off-by: Minfei Huang > -

[PATCH] aio: Cleanup unnecessary test for nr_pages

2016-06-12 Thread Minfei Huang
The variable nr_pages is always more than 1, because the size of structure aio_ring is bigger than 0. So remove unnecessary test for nr_page. Signed-off-by: Minfei Huang <mngh...@gmail.com> --- fs/aio.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index f

[PATCH] aio: Cleanup unnecessary test for nr_pages

2016-06-12 Thread Minfei Huang
The variable nr_pages is always more than 1, because the size of structure aio_ring is bigger than 0. So remove unnecessary test for nr_page. Signed-off-by: Minfei Huang --- fs/aio.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index fb8e45b..ec05137 100644 --- a/fs

Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in function pvclock_read_flags

2016-06-12 Thread Minfei Huang
On 06/09/16 at 01:28P, Borislav Petkov wrote: > On Thu, Jun 09, 2016 at 01:21:18PM +0200, Paolo Bonzini wrote: > > This is basically implementing a seqcount. It needs two barriers and, > > Why does it need the two barriers? More details please. Hi, Borislav. It's a seqcount-like. We should

Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in function pvclock_read_flags

2016-06-12 Thread Minfei Huang
On 06/09/16 at 01:28P, Borislav Petkov wrote: > On Thu, Jun 09, 2016 at 01:21:18PM +0200, Paolo Bonzini wrote: > > This is basically implementing a seqcount. It needs two barriers and, > > Why does it need the two barriers? More details please. Hi, Borislav. It's a seqcount-like. We should

Re: [PATCH] pvclock: introduce seqcount-like API

2016-06-12 Thread Minfei Huang
On 06/09/16 at 01:23P, Paolo Bonzini wrote: > The version field in struct pvclock_vcpu_time_info basically implements > a seqcount. Wrap it with the usual read_begin and read_retry functions, > and use these APIs instead of peppering the code with smp_rmb()s. > While at it, change it to the more

Re: [PATCH] pvclock: introduce seqcount-like API

2016-06-12 Thread Minfei Huang
On 06/09/16 at 01:23P, Paolo Bonzini wrote: > The version field in struct pvclock_vcpu_time_info basically implements > a seqcount. Wrap it with the usual read_begin and read_retry functions, > and use these APIs instead of peppering the code with smp_rmb()s. > While at it, change it to the more

Re: [PATCH] x86:pvclock: add missing barriers

2016-06-12 Thread Minfei Huang
On 06/08/16 at 09:45P, Borislav Petkov wrote: > On Wed, Jun 08, 2016 at 09:11:39PM +0300, Roman Kagan wrote: > > Gradual removal of excessive barriers in pvclock reading functions > > (commits 502dfeff239e8313bfbe906ca0a1a6827ac8481b, > > a3eb97bd80134ba07864ca00747466c02118aca1) ended up removing

Re: [PATCH] x86:pvclock: add missing barriers

2016-06-12 Thread Minfei Huang
On 06/08/16 at 09:45P, Borislav Petkov wrote: > On Wed, Jun 08, 2016 at 09:11:39PM +0300, Roman Kagan wrote: > > Gradual removal of excessive barriers in pvclock reading functions > > (commits 502dfeff239e8313bfbe906ca0a1a6827ac8481b, > > a3eb97bd80134ba07864ca00747466c02118aca1) ended up removing

Re: [PATCH V2] Use MACRO UINT_MAX instead of actual value

2016-06-07 Thread Minfei Huang
Ping. Any comment is appreciate. Thanks Minfei On 05/17/16 at 03:58P, Minfei Huang wrote: > It's more elegant to use MACRO UINT_MAX to represent the max value of > type unsigned int. So replace the actual value by using this MACRO. > > Signed-off-by: Minfei Huang <mngh...@gmail.

Re: [PATCH V2] Use MACRO UINT_MAX instead of actual value

2016-06-07 Thread Minfei Huang
Ping. Any comment is appreciate. Thanks Minfei On 05/17/16 at 03:58P, Minfei Huang wrote: > It's more elegant to use MACRO UINT_MAX to represent the max value of > type unsigned int. So replace the actual value by using this MACRO. > > Signed-off-by: Minfei Huang > --- >

Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in function pvclock_read_flags

2016-06-07 Thread Minfei Huang
ping. Any comment is appreciate. Thanks Minfei On 05/28/16 at 08:27P, Minfei Huang wrote: > There is a generic function __pvclock_read_cycles to be used to get both > flags and cycles. For function pvclock_read_flags, it's useless to get > cycles value. To make this function be more

Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in function pvclock_read_flags

2016-06-07 Thread Minfei Huang
ping. Any comment is appreciate. Thanks Minfei On 05/28/16 at 08:27P, Minfei Huang wrote: > There is a generic function __pvclock_read_cycles to be used to get both > flags and cycles. For function pvclock_read_flags, it's useless to get > cycles value. To make this function be more

[PATCH] loop: Make user notify for adding loop device failed

2016-06-06 Thread Minfei Huang
There is no error number returned if loop driver fails in function alloc_disk to add new loop device. Add a correct error number to make user notify in this case. Signed-off-by: Minfei Huang <mngh...@gmail.com> --- drivers/block/loop.c | 1 + 1 file changed, 1 insertion(+) diff --git a/d

[PATCH] loop: Make user notify for adding loop device failed

2016-06-06 Thread Minfei Huang
There is no error number returned if loop driver fails in function alloc_disk to add new loop device. Add a correct error number to make user notify in this case. Signed-off-by: Minfei Huang --- drivers/block/loop.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/block/loop.c b

[PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in function pvclock_read_flags

2016-05-28 Thread Minfei Huang
There is a generic function __pvclock_read_cycles to be used to get both flags and cycles. For function pvclock_read_flags, it's useless to get cycles value. To make this function be more effective, get this variable flags directly in function. Signed-off-by: Minfei Huang <mngh...@gmail.

[PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in function pvclock_read_flags

2016-05-28 Thread Minfei Huang
There is a generic function __pvclock_read_cycles to be used to get both flags and cycles. For function pvclock_read_flags, it's useless to get cycles value. To make this function be more effective, get this variable flags directly in function. Signed-off-by: Minfei Huang --- v1: - Get rid

Re: [PATCH 3/3] pvclock: Add a new wrapper function to only get variable flags

2016-05-28 Thread Minfei Huang
On 05/27/16 at 06:06P, Paolo Bonzini wrote: > > > On 27/05/2016 17:40, Andy Lutomirski wrote: > > On Thu, May 26, 2016 at 11:17 PM, Minfei Huang <mngh...@gmail.com> wrote: > >> There is a generic function __pvclock_read_cycles to be used to get both >

Re: [PATCH 3/3] pvclock: Add a new wrapper function to only get variable flags

2016-05-28 Thread Minfei Huang
On 05/27/16 at 06:06P, Paolo Bonzini wrote: > > > On 27/05/2016 17:40, Andy Lutomirski wrote: > > On Thu, May 26, 2016 at 11:17 PM, Minfei Huang wrote: > >> There is a generic function __pvclock_read_cycles to be used to get both > >> flags and cycles. For

[PATCH 1/3] pvclock: Add CPU barries to get correct version value

2016-05-27 Thread Minfei Huang
them. Add CPU barries after getting version value just like what function vread_pvclock does, because all of callees in this function is inline. Signed-off-by: Minfei Huang <mngh...@gmail.com> --- arch/x86/include/asm/pvclock.h | 2 ++ arch/x86/kernel/pvclock.c | 4 2 files chang

[PATCH 3/3] pvclock: Add a new wrapper function to only get variable flags

2016-05-27 Thread Minfei Huang
There is a generic function __pvclock_read_cycles to be used to get both flags and cycles. For function pvclock_read_flags, it's useless to get cycles value. To make this function be more effective, add a new wrapper function to only get variable flags. Signed-off-by: Minfei Huang <m

[PATCH 2/3] pvclock: Cleanup to remove function pvclock_get_nsec_offset

2016-05-27 Thread Minfei Huang
Function __pvclock_read_cycles is short enough, so there is no need to have another function pvclock_get_nsec_offset to calculate tsc delta. It's better to combine it into function __pvclock_read_cycles. Remove useless variables in function __pvclock_read_cycles. Signed-off-by: Minfei Huang

[PATCH 1/3] pvclock: Add CPU barries to get correct version value

2016-05-27 Thread Minfei Huang
them. Add CPU barries after getting version value just like what function vread_pvclock does, because all of callees in this function is inline. Signed-off-by: Minfei Huang --- arch/x86/include/asm/pvclock.h | 2 ++ arch/x86/kernel/pvclock.c | 4 2 files changed, 6 insertions(+) diff --

[PATCH 3/3] pvclock: Add a new wrapper function to only get variable flags

2016-05-27 Thread Minfei Huang
There is a generic function __pvclock_read_cycles to be used to get both flags and cycles. For function pvclock_read_flags, it's useless to get cycles value. To make this function be more effective, add a new wrapper function to only get variable flags. Signed-off-by: Minfei Huang --- arch/x86

[PATCH 2/3] pvclock: Cleanup to remove function pvclock_get_nsec_offset

2016-05-27 Thread Minfei Huang
Function __pvclock_read_cycles is short enough, so there is no need to have another function pvclock_get_nsec_offset to calculate tsc delta. It's better to combine it into function __pvclock_read_cycles. Remove useless variables in function __pvclock_read_cycles. Signed-off-by: Minfei Huang

[PATCH V2] MAINTAINERS: add kexec_core.c and kexec_file.c

2016-05-25 Thread Minfei Huang
e still belong to kexec component. In order to get correct mail lists by using script get_maintainer.pl, add these files to MAINTAINERS. Signed-off-by: Minfei Huang <mngh...@gmail.com> --- v1: - use kexec* to match all of kexec related file --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(

[PATCH V2] MAINTAINERS: add kexec_core.c and kexec_file.c

2016-05-25 Thread Minfei Huang
e still belong to kexec component. In order to get correct mail lists by using script get_maintainer.pl, add these files to MAINTAINERS. Signed-off-by: Minfei Huang --- v1: - use kexec* to match all of kexec related file --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) dif

Re: [PATCH] MAINTAINERS: add kexec_core.c and kexec_file.c

2016-05-25 Thread Minfei Huang
On 05/25/16 at 05:54P, Joe Perches wrote: > On Wed, 2016-05-25 at 20:49 +0800, Minfei Huang wrote: > > > > From below commits, kexec.c is split to kexec.c, kexec_file.c and > > kexec_core.c. > > > > commit a43cac0d9dc2 ("kexec: split kexec_file syscall

Re: [PATCH] MAINTAINERS: add kexec_core.c and kexec_file.c

2016-05-25 Thread Minfei Huang
On 05/25/16 at 05:54P, Joe Perches wrote: > On Wed, 2016-05-25 at 20:49 +0800, Minfei Huang wrote: > > > > From below commits, kexec.c is split to kexec.c, kexec_file.c and > > kexec_core.c. > > > > commit a43cac0d9dc2 ("kexec: split kexec_file syscall

[PATCH] MAINTAINERS: add kexec_core.c and kexec_file.c

2016-05-25 Thread Minfei Huang
e still belong to kexec component. In order to get correct mail lists by using script get_maintainer.pl, add these files to MAINTAINERS. Signed-off-by: Minfei Huang <mngh...@gmail.com> --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS

[PATCH] MAINTAINERS: add kexec_core.c and kexec_file.c

2016-05-25 Thread Minfei Huang
e still belong to kexec component. In order to get correct mail lists by using script get_maintainer.pl, add these files to MAINTAINERS. Signed-off-by: Minfei Huang --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3302006..5f33f71 100644

[PATCH] kexec: Return error number directly

2016-05-25 Thread Minfei Huang
This is a cleanup patch to make kexec more clear to return error number directly. The variable result is useless, because there is no other function's return value assignes to it. So remove it. Signed-off-by: Minfei Huang <mngh...@gmail.com> --- kernel/kexec_core.c | 16 ++--

[PATCH] kexec: Return error number directly

2016-05-25 Thread Minfei Huang
This is a cleanup patch to make kexec more clear to return error number directly. The variable result is useless, because there is no other function's return value assignes to it. So remove it. Signed-off-by: Minfei Huang --- kernel/kexec_core.c | 16 ++-- 1 file changed, 6

[PATCH V2] Use MACRO UINT_MAX instead of actual value

2016-05-17 Thread Minfei Huang
It's more elegant to use MACRO UINT_MAX to represent the max value of type unsigned int. So replace the actual value by using this MACRO. Signed-off-by: Minfei Huang <mngh...@gmail.com> --- v1: - fix typo --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH V2] Use MACRO UINT_MAX instead of actual value

2016-05-17 Thread Minfei Huang
It's more elegant to use MACRO UINT_MAX to represent the max value of type unsigned int. So replace the actual value by using this MACRO. Signed-off-by: Minfei Huang --- v1: - fix typo --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme

Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables

2016-05-11 Thread Minfei Huang
On 05/11/16 at 04:24P, Paolo Bonzini wrote: > > > On 30/04/2016 23:57, Andy Lutomirski wrote: > >> > Should we kill __pvclock_read_cycles in favor of vread_pvclock? It looks > >> > doable at a quick scan... > >> > > > The in-kernel version might have to be a bit different because it > > needs to

Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables

2016-05-11 Thread Minfei Huang
On 05/11/16 at 04:24P, Paolo Bonzini wrote: > > > On 30/04/2016 23:57, Andy Lutomirski wrote: > >> > Should we kill __pvclock_read_cycles in favor of vread_pvclock? It looks > >> > doable at a quick scan... > >> > > > The in-kernel version might have to be a bit different because it > > needs to

Re: [PATCH] Make clocksource insert entry more efficiently

2016-05-02 Thread Minfei Huang
On 05/02/16 at 10:39P, John Stultz wrote: > On Mon, Apr 25, 2016 at 2:20 AM, Minfei Huang <mngh...@gmail.com> wrote: > > It is unnecessary to continue looping the list, if we find there is an > > entry that the value of rating is smaller than the new one. It is safe > >

Re: [PATCH] Make clocksource insert entry more efficiently

2016-05-02 Thread Minfei Huang
On 05/02/16 at 10:39P, John Stultz wrote: > On Mon, Apr 25, 2016 at 2:20 AM, Minfei Huang wrote: > > It is unnecessary to continue looping the list, if we find there is an > > entry that the value of rating is smaller than the new one. It is safe > > to be out the loop,

Re: [PATCH] Make clocksource insert entry more efficiently

2016-04-30 Thread Minfei Huang
Ping. Any comment is appreciate. Thanks Minfei On 04/25/16 at 05:20P, Minfei Huang wrote: > It is unnecessary to continue looping the list, if we find there is an > entry that the value of rating is smaller than the new one. It is safe > to be out the loop, because all of entry are

Re: [PATCH] Make clocksource insert entry more efficiently

2016-04-30 Thread Minfei Huang
Ping. Any comment is appreciate. Thanks Minfei On 04/25/16 at 05:20P, Minfei Huang wrote: > It is unnecessary to continue looping the list, if we find there is an > entry that the value of rating is smaller than the new one. It is safe > to be out the loop, because all of entry are

Re: [PATCH] Use MICRO UINT_MAX instead of actual value

2016-04-30 Thread Minfei Huang
Ping. Any comment is appreciate. Thanks Minfei On 04/25/16 at 11:13P, Minfei Huang wrote: > It's more elegant to use MICRO UINT_MAX to represent the max value of > type unsigned int. So replace the actual value by using this MICRO. > > Signed-off-by: Minfei Huang <mn

Re: [PATCH] Use MICRO UINT_MAX instead of actual value

2016-04-30 Thread Minfei Huang
Ping. Any comment is appreciate. Thanks Minfei On 04/25/16 at 11:13P, Minfei Huang wrote: > It's more elegant to use MICRO UINT_MAX to represent the max value of > type unsigned int. So replace the actual value by using this MICRO. > > Signed-off-by: Minfei Huang > --- >

Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables

2016-04-30 Thread Minfei Huang
ping. Any comment is appreciate. Thanks Minfei On 04/25/16 at 02:53P, Minfei Huang wrote: > The value of cycles and flags can be assigned directly without > intermediate variables. > > Remove the useless variables. > > Signed-off-by: Minfei Huang <mngh...@gmail.com> &

Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables

2016-04-30 Thread Minfei Huang
ping. Any comment is appreciate. Thanks Minfei On 04/25/16 at 02:53P, Minfei Huang wrote: > The value of cycles and flags can be assigned directly without > intermediate variables. > > Remove the useless variables. > > Signed-off-by: Minfei Huang > --- > arch/x86/in

Re: [PATCH] Use existing helper to convert "on/off" to boolean

2016-04-29 Thread Minfei Huang
On 04/29/16 at 02:21P, Andrew Morton wrote: > On Fri, 29 Apr 2016 13:47:04 +0800 Minfei Huang <mngh...@gmail.com> wrote: > > > It's more convenient to use existing function helper to convert string > > "on/off" to boolean. > > > > ... >

Re: [PATCH] Use existing helper to convert "on/off" to boolean

2016-04-29 Thread Minfei Huang
On 04/29/16 at 02:21P, Andrew Morton wrote: > On Fri, 29 Apr 2016 13:47:04 +0800 Minfei Huang wrote: > > > It's more convenient to use existing function helper to convert string > > "on/off" to boolean. > > > > ... > > > > --- a/lib/ks

Re: [RFC PATCH v2 06/18] x86: dump_trace() error handling

2016-04-29 Thread Minfei Huang
On 04/28/16 at 03:44P, Josh Poimboeuf wrote: > In preparation for being able to determine whether a given stack trace > is reliable, allow the stacktrace_ops functions to propagate errors to > dump_trace(). Hi, Josh. Have you considered to make walk_stack function as non-return function, since

Re: [RFC PATCH v2 06/18] x86: dump_trace() error handling

2016-04-29 Thread Minfei Huang
On 04/28/16 at 03:44P, Josh Poimboeuf wrote: > In preparation for being able to determine whether a given stack trace > is reliable, allow the stacktrace_ops functions to propagate errors to > dump_trace(). Hi, Josh. Have you considered to make walk_stack function as non-return function, since

Re: [PATCH] Use existing helper to convert "on/off" to boolean

2016-04-29 Thread Minfei Huang
On 04/29/16 at 10:04P, Michal Hocko wrote: > On Fri 29-04-16 13:47:04, Minfei Huang wrote: > > It's more convenient to use existing function helper to convert string > > "on/off" to boolean. > > But kstrtobool in linux-next only does "This routine return

Re: [PATCH] Use existing helper to convert "on/off" to boolean

2016-04-29 Thread Minfei Huang
On 04/29/16 at 10:04P, Michal Hocko wrote: > On Fri 29-04-16 13:47:04, Minfei Huang wrote: > > It's more convenient to use existing function helper to convert string > > "on/off" to boolean. > > But kstrtobool in linux-next only does "This routine return

[PATCH] Use existing helper to convert "on/off" to boolean

2016-04-28 Thread Minfei Huang
It's more convenient to use existing function helper to convert string "on/off" to boolean. Signed-off-by: Minfei Huang <mngh...@gmail.com> --- lib/kstrtox.c| 2 +- mm/page_alloc.c | 9 + mm/page_poison.c | 8 +--- 3 files changed, 3 insertions(+), 16 deletion

[PATCH] Use existing helper to convert "on/off" to boolean

2016-04-28 Thread Minfei Huang
It's more convenient to use existing function helper to convert string "on/off" to boolean. Signed-off-by: Minfei Huang --- lib/kstrtox.c| 2 +- mm/page_alloc.c | 9 + mm/page_poison.c | 8 +--- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/lib/kstrt

Re: [PATCH] Use MICRO UINT_MAX instead of actual value

2016-04-25 Thread Minfei Huang
On 04/25/16 at 12:44P, Sagi Grimberg wrote: > > >It's more elegant to use MICRO UINT_MAX to represent the max value of > >type unsigned int. So replace the actual value by using this MICRO. > > You mean macro right? Yep. Sorry for the typo error. Thanks Minfei

Re: [PATCH] Use MICRO UINT_MAX instead of actual value

2016-04-25 Thread Minfei Huang
On 04/25/16 at 12:44P, Sagi Grimberg wrote: > > >It's more elegant to use MICRO UINT_MAX to represent the max value of > >type unsigned int. So replace the actual value by using this MICRO. > > You mean macro right? Yep. Sorry for the typo error. Thanks Minfei

[PATCH] Make clocksource insert entry more efficiently

2016-04-25 Thread Minfei Huang
It is unnecessary to continue looping the list, if we find there is an entry that the value of rating is smaller than the new one. It is safe to be out the loop, because all of entry are inserted in descending order. Signed-off-by: Minfei Huang <mngh...@gmail.com> --- kernel/time/clockso

[PATCH] Make clocksource insert entry more efficiently

2016-04-25 Thread Minfei Huang
It is unnecessary to continue looping the list, if we find there is an entry that the value of rating is smaller than the new one. It is safe to be out the loop, because all of entry are inserted in descending order. Signed-off-by: Minfei Huang --- kernel/time/clocksource.c | 8 +--- 1 file

[PATCH] Cleanup __pvclock_read_cycles to remove useless variables

2016-04-25 Thread Minfei Huang
The value of cycles and flags can be assigned directly without intermediate variables. Remove the useless variables. Signed-off-by: Minfei Huang <mngh...@gmail.com> --- arch/x86/include/asm/pvclock.h | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/ar

[PATCH] Cleanup __pvclock_read_cycles to remove useless variables

2016-04-25 Thread Minfei Huang
The value of cycles and flags can be assigned directly without intermediate variables. Remove the useless variables. Signed-off-by: Minfei Huang --- arch/x86/include/asm/pvclock.h | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm

[PATCH] Use MICRO UINT_MAX instead of actual value

2016-04-24 Thread Minfei Huang
It's more elegant to use MICRO UINT_MAX to represent the max value of type unsigned int. So replace the actual value by using this MICRO. Signed-off-by: Minfei Huang <mngh...@gmail.com> --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver

[PATCH] Use MICRO UINT_MAX instead of actual value

2016-04-24 Thread Minfei Huang
It's more elegant to use MICRO UINT_MAX to represent the max value of type unsigned int. So replace the actual value by using this MICRO. Signed-off-by: Minfei Huang --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b

  1   2   3   4   5   >