All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: mm-commits@vger.kernel.org, senozhatsky@chromium.org,
	ngupta@vflare.org, minchan@kernel.org, ubizjak@gmail.com
Subject: Re: + zram-use-try_cmpxchg-in-update_used_max.patch added to mm-unstable branch
Date: Wed, 26 Oct 2022 19:31:21 +0900	[thread overview]
Message-ID: <Y1kMeRsIX8kIKzpH@google.com> (raw)
In-Reply-To: <20221018205005.52F6CC433C1@smtp.kernel.org>

On (22/10/18 13:50), Andrew Morton wrote:
> Use try_cmpxchg instead of cmpxchg (*ptr, old, new) == old in
> update_used_max.  x86 CMPXCHG instruction returns success in ZF flag, so
> this change saves a compare after cmpxchg (and related move instruction in
> front of cmpxchg).
> 
> Also, reorder code a bit to remove additional compare and conditional jump
> from the assembly code.  Together, hese two changes save 15 bytes from the
> function when compiled for x86_64.
> 
> No functional change intended.
> 
> Link: https://lkml.kernel.org/r/20221018145154.3699-1-ubizjak@gmail.com
> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> Cc: Minchan Kim <minchan@kernel.org>
> Cc: Nitin Gupta <ngupta@vflare.org>
> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

I totally missed that patch.

Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>

      reply	other threads:[~2022-10-26 10:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18 20:50 + zram-use-try_cmpxchg-in-update_used_max.patch added to mm-unstable branch Andrew Morton
2022-10-26 10:31 ` Sergey Senozhatsky [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=Y1kMeRsIX8kIKzpH@google.com \
    --to=senozhatsky@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minchan@kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=ngupta@vflare.org \
    --cc=ubizjak@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 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.