From: Yu Zhao <yuzhao@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Yu Zhao <yuzhao@google.com>
Subject: [PATCH mm-unstable v1 0/5] mm/swap: remove boilerplate
Date: Wed, 10 Jul 2024 20:13:12 -0600 [thread overview]
Message-ID: <20240711021317.596178-1-yuzhao@google.com> (raw)
Use folio_activate() as an example:
Before this series
------------------
if (!folio_test_active(folio) && !folio_test_unevictable(folio)) {
struct folio_batch *fbatch;
folio_get(folio);
if (!folio_test_clear_lru(folio)) {
folio_put(folio);
return;
}
local_lock(&cpu_fbatches.lock);
fbatch = this_cpu_ptr(&cpu_fbatches.activate);
folio_batch_add_and_move(fbatch, folio, folio_activate_fn);
local_unlock(&cpu_fbatches.lock);
}
}
After this series
-----------------
void folio_activate(struct folio *folio)
{
if (folio_test_active(folio) || folio_test_unevictable(folio))
return;
folio_batch_add_and_move(folio, lru_activate, true);
}
And this is applied to all 6 folio_batch handlers in mm/swap.c.
bloat-o-meter
-------------
add/remove: 12/13 grow/shrink: 3/2 up/down: 4653/-4721 (-68)
...
Total: Before=28083019, After=28082951, chg -0.00%
Yu Zhao (5):
mm/swap: reduce indentation level
mm/swap: rename cpu_fbatches->activate
mm/swap: fold lru_rotate into cpu_fbatches
mm/swap: remove remaining _fn suffix
mm/swap: remove boilerplate
mm/swap.c | 296 ++++++++++++++++++++++++------------------------------
1 file changed, 134 insertions(+), 162 deletions(-)
--
2.45.2.803.g4e1b14247a-goog
next reply other threads:[~2024-07-11 2:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-11 2:13 Yu Zhao [this message]
2024-07-11 2:13 ` [PATCH mm-unstable v1 1/5] mm/swap: reduce indentation level Yu Zhao
2024-07-11 2:13 ` [PATCH mm-unstable v1 2/5] mm/swap: rename cpu_fbatches->activate Yu Zhao
2024-07-11 2:13 ` [PATCH mm-unstable v1 3/5] mm/swap: fold lru_rotate into cpu_fbatches Yu Zhao
2024-07-11 2:13 ` [PATCH mm-unstable v1 4/5] mm/swap: remove remaining _fn suffix Yu Zhao
2024-07-11 2:13 ` [PATCH mm-unstable v1 5/5] mm/swap: remove boilerplate Yu Zhao
2024-07-26 5:48 ` Barry Song
2024-07-26 5:56 ` Barry Song
2024-07-26 6:50 ` Yu Zhao
2024-08-04 6:55 ` Hugh Dickins
2024-08-04 21:36 ` Yu Zhao
2024-08-05 19:14 ` Hugh Dickins
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=20240711021317.596178-1-yuzhao@google.com \
--to=yuzhao@google.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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