Linux-ext4 Archive on lore.kernel.org
 help / color / Atom feed
* [RFC] improve malloc for large filesystems: limit scanning at cr=0
@ 2019-12-02  8:50 Alex Zhuravlev
  0 siblings, 0 replies; only message in thread
From: Alex Zhuravlev @ 2019-12-02  8:50 UTC (permalink / raw)
  To: linux-ext4

Hi,

I refreshed the patches a bit.
So the initial patch is just to limit scanning at cr=0 to initialised groups.
The idea is that scanning at cr=0 is an optimisation on its own - cheap and quick way to find 2^N large chunks.
I think it makes no sense to wait on IO few milliseconds just to skip a group because it’s not perfect.

Thanks, Alex


--- linux-4.18/fs/ext4/mballoc.c	2019-11-28 14:55:26.500545920 +0300
+++ linux-4.18/fs/ext4/mballoc.c	2019-11-28 14:53:18.600086008 +0300
@@ -2060,7 +2060,15 @@ static int ext4_mb_good_group(struct
 
 	/* We only do this if the grp has never been initialized */
 	if (unlikely(EXT4_MB_GRP_NEED_INIT(grp))) {
-		int ret = ext4_mb_init_group(ac->ac_sb, group, GFP_NOFS);
+		int ret;
+
+		/* cr=0 is a very optimistic search to find large
+		 * good chunks almost for free. if buddy data is
+		 * not ready, then this optimization makes no sense */
+
+		if (cr == 0)
+			return 0;
+		ret = ext4_mb_init_group(ac->ac_sb, group, GFP_NOFS);
 		if (ret)
 			return ret;
 	}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-02  8:50 [RFC] improve malloc for large filesystems: limit scanning at cr=0 Alex Zhuravlev

Linux-ext4 Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-ext4/0 linux-ext4/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-ext4 linux-ext4/ https://lore.kernel.org/linux-ext4 \
		linux-ext4@vger.kernel.org
	public-inbox-index linux-ext4

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-ext4


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git