From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 00/10] Cleanup unnecessary get_extent parameters
Date: Mon, 6 Nov 2017 20:30:42 +0100 [thread overview]
Message-ID: <cover.1509996091.git.dsterba@suse.com> (raw)
There are several functions that take a generic get_extent parameter, but not
all of them use it to distinguish between btree_get_exnent (for metadata) and
btrfs_get_extent (for data). This is namely extent_read_full_page and
__do_readpage.
The rest can be cleaned up so that the desired get_extent callback is used
directly. The patchset does that incrementally so each change is clear.
The difference in binary code size is not that impressive:
text data bss dec hex filename
985353 75124 18560 1079037 1076fd pre/btrfs.ko
985193 75124 18560 1078877 10765d post/btrfs.ko
but the estimated stack consumption savings are about 64 bytes, and it could be
more if we calculate cummulative effect when more than one reduced function is
in the callchain:
-extent_io.c:btree_write_cache_pages 288 static
+extent_io.c:btree_write_cache_pages 280 static
-extent_io.c:extent_fiemap 264 dynamic,bounded
+extent_io.c:extent_fiemap 256 dynamic,bounded
-extent_io.c:extent_readpages 264 dynamic,bounded
+extent_io.c:extent_readpages 248 dynamic,bounded
-extent_io.c:extent_write_full_page 56 static
+extent_io.c:extent_write_full_page 48 static
-extent_io.c:extent_write_locked_range 200 static
+extent_io.c:extent_write_locked_range 192 static
-extent_io.c:extent_writepages 56 static
+extent_io.c:extent_writepages 48 static
-extent_io.c:get_extent_skip_holes 64 static
+extent_io.c:get_extent_skip_holes 56 static
(calculated with gcc -fstack-usage)
David Sterba (10):
btrfs: sink get_extent parameter to extent_writepages
btrfs: sink get_extent parameter to extent_write_locked_range
btrfs: sink get_extent parameter to extent_write_full_page
btrfs: drop get_extent from extent_page_data
btrfs: sink get_extent parameter to extent_fiemap
btrfs: sink get_extent parameter to get_extent_skip_holes
btrfs: sink get_extent parameter to extent_readpages
btrfs: sink get_extent parameter to __extent_readpages
btrfs: sink get_extent parameter to __do_contiguous_readpages
btrfs: sink get_extent parameter to read_extent_buffer_pages
fs/btrfs/disk-io.c | 8 ++++----
fs/btrfs/disk-io.h | 3 +++
fs/btrfs/extent_io.c | 55 ++++++++++++++++++++--------------------------------
fs/btrfs/extent_io.h | 12 ++++--------
fs/btrfs/inode.c | 10 ++++------
5 files changed, 36 insertions(+), 52 deletions(-)
--
2.14.3
next reply other threads:[~2017-11-06 19:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-06 19:30 David Sterba [this message]
2017-11-06 19:30 ` [PATCH 01/10] btrfs: sink get_extent parameter to extent_writepages David Sterba
2017-11-06 19:30 ` [PATCH 02/10] btrfs: sink get_extent parameter to extent_write_locked_range David Sterba
2017-11-06 19:30 ` [PATCH 03/10] btrfs: sink get_extent parameter to extent_write_full_page David Sterba
2017-11-06 19:30 ` [PATCH 04/10] btrfs: drop get_extent from extent_page_data David Sterba
2017-11-06 19:30 ` [PATCH 05/10] btrfs: sink get_extent parameter to extent_fiemap David Sterba
2017-11-06 19:30 ` [PATCH 06/10] btrfs: sink get_extent parameter to get_extent_skip_holes David Sterba
2017-11-06 19:30 ` [PATCH 07/10] btrfs: sink get_extent parameter to extent_readpages David Sterba
2017-11-06 19:31 ` [PATCH 08/10] btrfs: sink get_extent parameter to __extent_readpages David Sterba
2017-11-06 19:31 ` [PATCH 09/10] btrfs: sink get_extent parameter to __do_contiguous_readpages David Sterba
2017-11-06 19:31 ` [PATCH 10/10] btrfs: sink get_extent parameter to read_extent_buffer_pages David Sterba
2017-11-06 21:26 ` [PATCH 00/10] Cleanup unnecessary get_extent parameters Nikolay Borisov
2017-11-07 20:13 ` David Sterba
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=cover.1509996091.git.dsterba@suse.com \
--to=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.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 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.