All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Liu Xiang <liu.xiang@zlingsmart.com>, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, liuxiang_1999@126.com
Subject: Re: [PATCH] mm: compaction: remove duplicate !list_empty(&sublist) check
Date: Wed, 9 Jun 2021 13:27:46 +0200	[thread overview]
Message-ID: <bba6e865-ff2e-4c01-b95d-3b1a9e6dc0da@redhat.com> (raw)
In-Reply-To: <20210609095409.19920-1-liu.xiang@zlingsmart.com>

On 09.06.21 11:54, Liu Xiang wrote:
> The list_splice_tail(&sublist, freelist) also do
> !list_empty(&sublist) check, so remove the duplicate call.
> 
> Signed-off-by: Liu Xiang <liu.xiang@zlingsmart.com>
> ---
>   mm/compaction.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 84fde270a..5b1dc832f 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -1297,8 +1297,7 @@ move_freelist_head(struct list_head *freelist, struct page *freepage)
>   
>   	if (!list_is_last(freelist, &freepage->lru)) {
>   		list_cut_before(&sublist, freelist, &freepage->lru);
> -		if (!list_empty(&sublist))
> -			list_splice_tail(&sublist, freelist);
> +		list_splice_tail(&sublist, freelist);
>   	}
>   }
>   
> @@ -1315,8 +1314,7 @@ move_freelist_tail(struct list_head *freelist, struct page *freepage)
>   
>   	if (!list_is_first(freelist, &freepage->lru)) {
>   		list_cut_position(&sublist, freelist, &freepage->lru);
> -		if (!list_empty(&sublist))
> -			list_splice_tail(&sublist, freelist);
> +		list_splice_tail(&sublist, freelist);
>   	}
>   }
>   
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb


      reply	other threads:[~2021-06-09 11:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09  9:54 [PATCH] mm: compaction: remove duplicate !list_empty(&sublist) check Liu Xiang
2021-06-09 11:27 ` David Hildenbrand [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=bba6e865-ff2e-4c01-b95d-3b1a9e6dc0da@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liu.xiang@zlingsmart.com \
    --cc=liuxiang_1999@126.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.