linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [Patch] mempolicy: remove redundant code
@ 2010-03-12 10:24 Bob Liu
  2010-03-12 20:37 ` David Rientjes
  0 siblings, 1 reply; 9+ messages in thread
From: Bob Liu @ 2010-03-12 10:24 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, andi

1. In funtion is_valid_nodemask(), varibable k will be inited to 0 in
the following loop, needn't init to policy_zone anymore.

2. (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES) has already defined
to MPOL_MODE_FLAGS in mempolicy.h.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
 ---
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index bda230e..66d71f4 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -128,9 +128,6 @@ static int is_valid_nodemask(const nodemask_t *nodemask)
 {
        int nd, k;

-       /* Check that there is something useful in this mask */
-       k = policy_zone;
-
        for_each_node_mask(nd, *nodemask) {
                struct zone *z;

@@ -146,7 +143,7 @@ static int is_valid_nodemask(const nodemask_t *nodemask)

 static inline int mpol_store_user_nodemask(const struct mempolicy *pol)
 {
-       return pol->flags & (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES);
+    return pol->flags & MPOL_MODE_FLAGS;
 }

 static void mpol_relative_nodemask(nodemask_t *ret, const nodemask_t *orig,
--
1.6.6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [Patch] mempolicy: remove redundant code
  2010-03-12 10:24 [Patch] mempolicy: remove redundant code Bob Liu
@ 2010-03-12 20:37 ` David Rientjes
  2010-03-13  5:03   ` Bob Liu
  0 siblings, 1 reply; 9+ messages in thread
From: David Rientjes @ 2010-03-12 20:37 UTC (permalink / raw)
  To: Bob Liu; +Cc: Andrew Morton, linux-mm, Andi Kleen

On Fri, 12 Mar 2010, Bob Liu wrote:

> 1. In funtion is_valid_nodemask(), varibable k will be inited to 0 in
> the following loop, needn't init to policy_zone anymore.
> 
> 2. (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES) has already defined
> to MPOL_MODE_FLAGS in mempolicy.h.
> 
> Signed-off-by: Bob Liu <lliubbo@gmail.com>

I like your patch, but it has whitespace damage.  Would it be possible to 
read the gmail section of Documentation/email-clients.txt and try to 
repropose it?  Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [PATCH] mempolicy: remove redundant code
@ 2010-03-13  5:01 Bob Liu
  2010-03-13  9:52 ` David Rientjes
  0 siblings, 1 reply; 9+ messages in thread
From: Bob Liu @ 2010-03-13  5:01 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, andi, rientjes, Bob Liu

From: Bob Liu <lliubbo@gmail.com>

1. In funtion is_valid_nodemask(), varibable k will be inited to 0 in
the following loop, needn't init to policy_zone anymore.

2. (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES) has already defined
to MPOL_MODE_FLAGS in mempolicy.h.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
---
 mempolicy.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/mempolicy.c b/mempolicy.c
index bda230e..b6fbcbd 100644
--- a/mempolicy.c
+++ b/mempolicy.c
@@ -128,9 +128,6 @@ static int is_valid_nodemask(const nodemask_t *nodemask)
 {
 	int nd, k;
 
-	/* Check that there is something useful in this mask */
-	k = policy_zone;
-
 	for_each_node_mask(nd, *nodemask) {
 		struct zone *z;
 
@@ -146,7 +143,7 @@ static int is_valid_nodemask(const nodemask_t *nodemask)
 
 static inline int mpol_store_user_nodemask(const struct mempolicy *pol)
 {
-	return pol->flags & (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES);
+	return pol->flags & MPOL_MODE_FLAGS;
 }
 
 static void mpol_relative_nodemask(nodemask_t *ret, const nodemask_t *orig,
-- 
1.5.6.3

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [Patch] mempolicy: remove redundant code
  2010-03-12 20:37 ` David Rientjes
@ 2010-03-13  5:03   ` Bob Liu
  0 siblings, 0 replies; 9+ messages in thread
From: Bob Liu @ 2010-03-13  5:03 UTC (permalink / raw)
  To: David Rientjes; +Cc: Andrew Morton, linux-mm, Andi Kleen

On Sat, Mar 13, 2010 at 4:37 AM, David Rientjes <rientjes@google.com> wrote:
> On Fri, 12 Mar 2010, Bob Liu wrote:
>
>> 1. In funtion is_valid_nodemask(), varibable k will be inited to 0 in
>> the following loop, needn't init to policy_zone anymore.
>>
>> 2. (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES) has already defined
>> to MPOL_MODE_FLAGS in mempolicy.h.
>>
>> Signed-off-by: Bob Liu <lliubbo@gmail.com>
>
> I like your patch, but it has whitespace damage.  Would it be possible to
> read the gmail section of Documentation/email-clients.txt and try to
> repropose it?  Thanks.
>

I am sorry for that, I have resend that patch. Thanks a lot for your reply.

-- 
Regards,
-Bob Liu

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mempolicy: remove redundant code
  2010-03-13  5:01 [PATCH] " Bob Liu
@ 2010-03-13  9:52 ` David Rientjes
  2010-03-13 12:33   ` Bob Liu
  0 siblings, 1 reply; 9+ messages in thread
From: David Rientjes @ 2010-03-13  9:52 UTC (permalink / raw)
  To: Bob Liu; +Cc: Andrew Morton, linux-mm, Andi Kleen

On Sat, 13 Mar 2010, Bob Liu wrote:

> diff --git a/mempolicy.c b/mempolicy.c
> index bda230e..b6fbcbd 100644
> --- a/mempolicy.c
> +++ b/mempolicy.c

What git tree is this?  Your patch needs to change mm/mempolicy.c.

Please clone Linus' repository and then create a patch against that:

	git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
	cd linux-2.6
	<change mm/mempolicy.c>
	<compile, test>
	git commit -a
	git format-patch HEAD^

and send the .patch file.

Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mempolicy: remove redundant code
  2010-03-13  9:52 ` David Rientjes
@ 2010-03-13 12:33   ` Bob Liu
  0 siblings, 0 replies; 9+ messages in thread
From: Bob Liu @ 2010-03-13 12:33 UTC (permalink / raw)
  To: David Rientjes; +Cc: Andrew Morton, linux-mm, Andi Kleen

On Sat, Mar 13, 2010 at 5:52 PM, David Rientjes <rientjes@google.com> wrote:
> On Sat, 13 Mar 2010, Bob Liu wrote:
>
>> diff --git a/mempolicy.c b/mempolicy.c
>> index bda230e..b6fbcbd 100644
>> --- a/mempolicy.c
>> +++ b/mempolicy.c
>
> What git tree is this?  Your patch needs to change mm/mempolicy.c.
>

It's linux-next.
Yeah, I forgot the mm/ path, sorry. I need send it again or just reply
in this mail?
Thanks a lot!

> Please clone Linus' repository and then create a patch against that:
>
>        git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
>        cd linux-2.6
>        <change mm/mempolicy.c>
>        <compile, test>
>        git commit -a
>        git format-patch HEAD^
>
> and send the .patch file.
>
> Thanks.
>

-- 
Regards,
-Bob Liu

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [PATCH] mempolicy: remove redundant code
@ 2010-03-14 11:50 Bob Liu
  2010-03-14 23:18 ` David Rientjes
  0 siblings, 1 reply; 9+ messages in thread
From: Bob Liu @ 2010-03-14 11:50 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, andi, rientjes, Bob Liu

From: Bob Liu <lliubbo@gmail.com>

1. In funtion is_valid_nodemask(), varibable k will be inited to 0 in
the following loop, needn't init to policy_zone anymore.

2. (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES) has already defined
to MPOL_MODE_FLAGS in mempolicy.h.
---
 mempolicy.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index bda230e..b6fbcbd 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -128,9 +128,6 @@ static int is_valid_nodemask(const nodemask_t *nodemask)
 {
 	int nd, k;
 
-	/* Check that there is something useful in this mask */
-	k = policy_zone;
-
 	for_each_node_mask(nd, *nodemask) {
 		struct zone *z;
 
@@ -146,7 +143,7 @@ static int is_valid_nodemask(const nodemask_t *nodemask)
 
 static inline int mpol_store_user_nodemask(const struct mempolicy *pol)
 {
-	return pol->flags & (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES);
+	return pol->flags & MPOL_MODE_FLAGS;
 }
 
 static void mpol_relative_nodemask(nodemask_t *ret, const nodemask_t *orig,
-- 
1.5.6.3

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mempolicy: remove redundant code
  2010-03-14 11:50 Bob Liu
@ 2010-03-14 23:18 ` David Rientjes
  2010-03-15  1:11   ` Bob Liu
  0 siblings, 1 reply; 9+ messages in thread
From: David Rientjes @ 2010-03-14 23:18 UTC (permalink / raw)
  To: Bob Liu; +Cc: Andrew Morton, linux-mm, Andi Kleen

On Sun, 14 Mar 2010, Bob Liu wrote:

> From: Bob Liu <lliubbo@gmail.com>
> 
> 1. In funtion is_valid_nodemask(), varibable k will be inited to 0 in
> the following loop, needn't init to policy_zone anymore.
> 
> 2. (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES) has already defined
> to MPOL_MODE_FLAGS in mempolicy.h.

Acked-by: David Rientjes <rientjes@google.com>

> ---
>  mempolicy.c |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
> 

(although the diffstat still doesn't have the mm/ path).

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mempolicy: remove redundant code
  2010-03-14 23:18 ` David Rientjes
@ 2010-03-15  1:11   ` Bob Liu
  0 siblings, 0 replies; 9+ messages in thread
From: Bob Liu @ 2010-03-15  1:11 UTC (permalink / raw)
  To: David Rientjes; +Cc: Andrew Morton, linux-mm, Andi Kleen

On Mon, Mar 15, 2010 at 7:18 AM, David Rientjes <rientjes@google.com> wrote:
> On Sun, 14 Mar 2010, Bob Liu wrote:
>
>> From: Bob Liu <lliubbo@gmail.com>
>>
>> 1. In funtion is_valid_nodemask(), varibable k will be inited to 0 in
>> the following loop, needn't init to policy_zone anymore.
>>
>> 2. (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES) has already defined
>> to MPOL_MODE_FLAGS in mempolicy.h.
>
> Acked-by: David Rientjes <rientjes@google.com>
>
>> ---
>>  mempolicy.c |    5 +----
>>  1 files changed, 1 insertions(+), 4 deletions(-)
>>
>
> (although the diffstat still doesn't have the mm/ path).
>

Thanks a lot, I will check more careful next time :-)

-- 
Regards,
-Bob Liu

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2010-03-15  1:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-12 10:24 [Patch] mempolicy: remove redundant code Bob Liu
2010-03-12 20:37 ` David Rientjes
2010-03-13  5:03   ` Bob Liu
  -- strict thread matches above, loose matches on Subject: below --
2010-03-13  5:01 [PATCH] " Bob Liu
2010-03-13  9:52 ` David Rientjes
2010-03-13 12:33   ` Bob Liu
2010-03-14 11:50 Bob Liu
2010-03-14 23:18 ` David Rientjes
2010-03-15  1:11   ` Bob Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).