From: Bob Liu <lliubbo@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, andi@firstfloor.org, rientjes@google.com,
lee.schermerhorn@hp.com, Bob Liu <lliubbo@gmail.com>
Subject: Re: [PATCH 2/2] mempolicy: remove redundant check
Date: Thu, 18 Mar 2010 21:19:49 +0800 [thread overview]
Message-ID: <cf18f8341003180619va7d06fbt5904592dedbc373d@mail.gmail.com> (raw)
In-Reply-To: <1268916463-8757-1-git-send-email-user@bob-laptop>
On Thu, Mar 18, 2010 at 8:47 PM, Bob Liu <lliubbo@gmail.com> wrote:
> From: Bob Liu <lliubbo@gmail.com>
>
> Lee's patch "mempolicy: use MPOL_PREFERRED for system-wide
> default policy" has made the MPOL_DEFAULT only used in the
> memory policy APIs. So, no need to check in __mpol_equal also.
> Also get rid of mpol_match_intent() and move its logic directly
> into __mpol_equal().
>
> Signed-off-by: Bob Liu <lliubbo@gmail.com>
> ---
> mm/mempolicy.c | 16 +++++-----------
> 1 files changed, 5 insertions(+), 11 deletions(-)
>
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index b88e914..17df048 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -1787,16 +1787,6 @@ struct mempolicy *__mpol_cond_copy(struct mempolicy *tompol,
> return tompol;
> }
>
> -static int mpol_match_intent(const struct mempolicy *a,
> - const struct mempolicy *b)
> -{
> - if (a->flags != b->flags)
> - return 0;
> - if (!mpol_store_user_nodemask(a))
> - return 1;
> - return nodes_equal(a->w.user_nodemask, b->w.user_nodemask);
> -}
> -
> /* Slow path of a mempolicy comparison */
> int __mpol_equal(struct mempolicy *a, struct mempolicy *b)
> {
> @@ -1804,7 +1794,11 @@ int __mpol_equal(struct mempolicy *a, struct mempolicy *b)
> return 0;
> if (a->mode != b->mode)
> return 0;
> - if (a->mode != MPOL_DEFAULT && !mpol_match_intent(a, b))
> + if (a->flags != b->flags)
> + return 0;
> + if (mpol_store_user_nodemask(a))
> + return 0;
> + if (!nodes_equal(a->w.user_nodemask, b->w.user_nodemask))
> return 0;
> switch (a->mode) {
> case MPOL_BIND:
This patch is uncorrect, I have resend a new one :-)
> --
> 1.5.6.3
>
>
--
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>
prev parent reply other threads:[~2010-03-18 13:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-18 12:47 [PATCH 2/2] mempolicy: remove redundant check Bob Liu
2010-03-18 13:19 ` Bob Liu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cf18f8341003180619va7d06fbt5904592dedbc373d@mail.gmail.com \
--to=lliubbo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=lee.schermerhorn@hp.com \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).