From: Souptick Joarder <jrdr.linux@gmail.com>
To: Weikang shi <swkhack@gmail.com>
Cc: Linux-MM <linux-mm@kvack.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: Change count_mm_mlocked_page_nr return type
Date: Sat, 11 May 2019 13:40:47 +0530 [thread overview]
Message-ID: <CAFqt6zbxMKydJa=-TbPTWwxK-XJYyg=d-tV8AWfNSAA1Q2ugfA@mail.gmail.com> (raw)
In-Reply-To: <20190422103836.48566-1-swkhack@gmail.com>
On Mon, Apr 22, 2019 at 4:08 PM Weikang shi <swkhack@gmail.com> wrote:
>
> From: swkhack <swkhack@gmail.com>
>
> In 64-bit machine,the value of "vma->vm_end - vma->vm_start"
> maybe negative in 32bit int and the "count >> PAGE_SHIFT"'s rusult
s/rusult/result.
> will be wrong.So change the local variable and return
> value to unsigned long will fix the problem.
>
> Signed-off-by: swkhack <swkhack@gmail.com>
> ---
> mm/mlock.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/mlock.c b/mm/mlock.c
> index 080f3b364..d614163f5 100644
> --- a/mm/mlock.c
> +++ b/mm/mlock.c
> @@ -636,11 +636,11 @@ static int apply_vma_lock_flags(unsigned long start, size_t len,
> * is also counted.
> * Return value: previously mlocked page counts
> */
> -static int count_mm_mlocked_page_nr(struct mm_struct *mm,
> +static unsigned long count_mm_mlocked_page_nr(struct mm_struct *mm,
> unsigned long start, size_t len)
> {
> struct vm_area_struct *vma;
> - int count = 0;
> + unsigned long count = 0;
>
> if (mm == NULL)
> mm = current->mm;
> --
> 2.17.1
>
next prev parent reply other threads:[~2019-05-11 8:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-22 10:38 Weikang shi
2019-05-11 8:10 ` Souptick Joarder [this message]
2019-05-13 2:37 Weikang shi
2019-05-13 9:15 ` Michal Hocko
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='CAFqt6zbxMKydJa=-TbPTWwxK-XJYyg=d-tV8AWfNSAA1Q2ugfA@mail.gmail.com' \
--to=jrdr.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=swkhack@gmail.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