forked from osandov/drgn
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD
- Loading branch information
Showing
7 changed files
with
151 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
vmtest/patches/9p-fix-slab-cache-name-creation-for-real.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
From a360f311f57a36e96d88fa8086b749159714dcd2 Mon Sep 17 00:00:00 2001 | ||
Message-ID: <a360f311f57a36e96d88fa8086b749159714dcd2.1729551875.git.osandov@fb.com> | ||
From: Linus Torvalds <[email protected]> | ||
Date: Mon, 21 Oct 2024 11:57:38 -0700 | ||
Subject: [PATCH] 9p: fix slab cache name creation for real | ||
|
||
This was attempted by using the dev_name in the slab cache name, but as | ||
Omar Sandoval pointed out, that can be an arbitrary string, eg something | ||
like "/dev/root". Which in turn trips verify_dirent_name(), which fails | ||
if a filename contains a slash. | ||
|
||
So just make it use a sequence counter, and make it an atomic_t to avoid | ||
any possible races or locking issues. | ||
|
||
Reported-and-tested-by: Omar Sandoval <[email protected]> | ||
Link: https://lore.kernel.org/all/[email protected]/ | ||
Fixes: 79efebae4afc ("9p: Avoid creating multiple slab caches with the same name") | ||
Acked-by: Vlastimil Babka <[email protected]> | ||
Cc: Dominique Martinet <[email protected]> | ||
Cc: Thorsten Leemhuis <[email protected]> | ||
Signed-off-by: Linus Torvalds <[email protected]> | ||
--- | ||
net/9p/client.c | 4 +++- | ||
1 file changed, 3 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/net/9p/client.c b/net/9p/client.c | ||
index 9e7b9151816d..09f8ced9f8bb 100644 | ||
--- a/net/9p/client.c | ||
+++ b/net/9p/client.c | ||
@@ -977,6 +977,7 @@ static int p9_client_version(struct p9_client *c) | ||
struct p9_client *p9_client_create(const char *dev_name, char *options) | ||
{ | ||
int err; | ||
+ static atomic_t seqno = ATOMIC_INIT(0); | ||
struct p9_client *clnt; | ||
char *client_id; | ||
char *cache_name; | ||
@@ -1036,7 +1037,8 @@ struct p9_client *p9_client_create(const char *dev_name, char *options) | ||
if (err) | ||
goto close_trans; | ||
|
||
- cache_name = kasprintf(GFP_KERNEL, "9p-fcall-cache-%s", dev_name); | ||
+ cache_name = kasprintf(GFP_KERNEL, | ||
+ "9p-fcall-cache-%u", atomic_inc_return(&seqno)); | ||
if (!cache_name) { | ||
err = -ENOMEM; | ||
goto close_trans; | ||
-- | ||
2.47.0 | ||
|
77 changes: 77 additions & 0 deletions
77
vmtest/patches/lib-raid6-add-option-to-skip-algo-benchmarking.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
From be85f93ae2df32dea0b20908316f1d894c3e0f64 Mon Sep 17 00:00:00 2001 | ||
Message-ID: <be85f93ae2df32dea0b20908316f1d894c3e0f64.1729542372.git.osandov@fb.com> | ||
From: Daniel Verkamp <[email protected]> | ||
Date: Mon, 12 Nov 2018 15:26:52 -0800 | ||
Subject: [PATCH] lib/raid6: add option to skip algo benchmarking | ||
|
||
This is helpful for systems where fast startup time is important. | ||
It is especially nice to avoid benchmarking RAID functions that are | ||
never used (for example, BTRFS selects RAID6_PQ even if the parity RAID | ||
mode is not in use). | ||
|
||
This saves 250+ milliseconds of boot time on modern x86 and ARM systems | ||
with a dozen or more available implementations. | ||
|
||
The new option is defaulted to 'y' to match the previous behavior of | ||
always benchmarking on init. | ||
|
||
Signed-off-by: Daniel Verkamp <[email protected]> | ||
Signed-off-by: Shaohua Li <[email protected]> | ||
--- | ||
include/linux/raid/pq.h | 3 +++ | ||
lib/Kconfig | 8 ++++++++ | ||
lib/raid6/algos.c | 5 +++++ | ||
3 files changed, 16 insertions(+) | ||
|
||
diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h | ||
index d7c99161bba2..605cf46c17bd 100644 | ||
--- a/include/linux/raid/pq.h | ||
+++ b/include/linux/raid/pq.h | ||
@@ -70,6 +70,9 @@ extern const char raid6_empty_zero_page[PAGE_SIZE]; | ||
#define MODULE_DESCRIPTION(desc) | ||
#define subsys_initcall(x) | ||
#define module_exit(x) | ||
+ | ||
+#define IS_ENABLED(x) (x) | ||
+#define CONFIG_RAID6_PQ_BENCHMARK 1 | ||
#endif /* __KERNEL__ */ | ||
|
||
/* Routine choices */ | ||
diff --git a/lib/Kconfig b/lib/Kconfig | ||
index a9965f4af4dd..fcb05305a5a2 100644 | ||
--- a/lib/Kconfig | ||
+++ b/lib/Kconfig | ||
@@ -10,6 +10,14 @@ menu "Library routines" | ||
config RAID6_PQ | ||
tristate | ||
|
||
+config RAID6_PQ_BENCHMARK | ||
+ bool "Automatically choose fastest RAID6 PQ functions" | ||
+ depends on RAID6_PQ | ||
+ default y | ||
+ help | ||
+ Benchmark all available RAID6 PQ functions on init and choose the | ||
+ fastest one. | ||
+ | ||
config BITREVERSE | ||
tristate | ||
|
||
diff --git a/lib/raid6/algos.c b/lib/raid6/algos.c | ||
index a753ff56670f..7e4f7a8ffa8e 100644 | ||
--- a/lib/raid6/algos.c | ||
+++ b/lib/raid6/algos.c | ||
@@ -163,6 +163,11 @@ static inline const struct raid6_calls *raid6_choose_gen( | ||
if ((*algo)->valid && !(*algo)->valid()) | ||
continue; | ||
|
||
+ if (!IS_ENABLED(CONFIG_RAID6_PQ_BENCHMARK)) { | ||
+ best = *algo; | ||
+ break; | ||
+ } | ||
+ | ||
perf = 0; | ||
|
||
preempt_disable(); | ||
-- | ||
2.47.0 | ||
|