From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: yalin wang <yalin.wang2010@gmail.com>
Cc: akpm@linux-foundation.org, kirill.shutemov@linux.intel.com,
mgorman@suse.de, hannes@cmpxchg.org, riel@redhat.com,
raindel@mellanox.com, willy@linux.intel.com, boaz@plexistor.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: change tlb_finish_mmu() to be more simple
Date: Wed, 4 Nov 2015 10:33:35 +0200 [thread overview]
Message-ID: <20151104083335.GA7795@node.shutemov.name> (raw)
In-Reply-To: <1446622531-316-1-git-send-email-yalin.wang2010@gmail.com>
On Wed, Nov 04, 2015 at 03:35:31PM +0800, yalin wang wrote:
> This patch remove unneeded *next temp variable,
> make this function more simple to read.
>
> Signed-off-by: yalin wang <yalin.wang2010@gmail.com>
> ---
> mm/memory.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index 7f3b9f2..f0040ed 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -270,17 +270,16 @@ void tlb_flush_mmu(struct mmu_gather *tlb)
> */
> void tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
> {
> - struct mmu_gather_batch *batch, *next;
> + struct mmu_gather_batch *batch;
>
> tlb_flush_mmu(tlb);
>
> /* keep the page table cache within bounds */
> check_pgt_cache();
>
> - for (batch = tlb->local.next; batch; batch = next) {
> - next = batch->next;
> + for (batch = tlb->local.next; batch; batch = batch->next)
Use after free? No, thanks.
> free_pages((unsigned long)batch, 0);
> - }
> +
> tlb->local.next = NULL;
> }
>
> --
> 1.9.1
>
> --
> 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>
--
Kirill A. Shutemov
--
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>
next prev parent reply other threads:[~2015-11-04 8:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-04 7:35 yalin wang
2015-11-04 8:33 ` Kirill A. Shutemov [this message]
2015-11-04 8:36 ` Sergey Senozhatsky
2015-11-04 8:46 ` yalin wang
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=20151104083335.GA7795@node.shutemov.name \
--to=kirill@shutemov.name \
--cc=akpm@linux-foundation.org \
--cc=boaz@plexistor.com \
--cc=hannes@cmpxchg.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=raindel@mellanox.com \
--cc=riel@redhat.com \
--cc=willy@linux.intel.com \
--cc=yalin.wang2010@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