Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Kubecek <mkubecek@suse.cz>2019-02-14 14:03:42 +0100
committerMichal Kubecek <mkubecek@suse.cz>2019-02-14 14:03:42 +0100
commit4131d33fe5e86429d906df45d2749864a802fc5a (patch)
treef8dbe741d46d1179089d602cb64148033e4120ca
parent79f04e32ff08ed75274ada9ee52bad0e31686f75 (diff)
kobject: copy env blob in one go (bsc#1122982).
-rw-r--r--patches.fixes/kobject-copy-env-blob-in-one-go.patch70
-rw-r--r--series.conf1
2 files changed, 71 insertions, 0 deletions
diff --git a/patches.fixes/kobject-copy-env-blob-in-one-go.patch b/patches.fixes/kobject-copy-env-blob-in-one-go.patch
new file mode 100644
index 0000000000..28dcbb3061
--- /dev/null
+++ b/patches.fixes/kobject-copy-env-blob-in-one-go.patch
@@ -0,0 +1,70 @@
+From: Eric Dumazet <edumazet@google.com>
+Date: Tue, 19 Sep 2017 16:27:04 -0700
+Subject: kobject: copy env blob in one go
+Patch-mainline: v4.15-rc1
+Git-commit: 4a336a23d619e96aef37d4d054cfadcdd1b581ba
+References: bsc#1122982
+
+No need to iterate over strings, just copy in one efficient memcpy() call.
+
+Tested:
+time perf record "(for f in `seq 1 3000` ; do ip netns add tast$f; done)"
+[ perf record: Woken up 10 times to write data ]
+[ perf record: Captured and wrote 8.224 MB perf.data (~359301 samples) ]
+
+real 0m52.554s # instead of 1m7.492s
+user 0m0.309s
+sys 0m51.375s # instead of 1m6.875s
+
+ 9.88% ip [kernel.kallsyms] [k] netlink_broadcast_filtered
+ 8.86% ip [kernel.kallsyms] [k] string
+ 7.37% ip [kernel.kallsyms] [k] __ip6addrlbl_add
+ 5.68% ip [kernel.kallsyms] [k] netlink_has_listeners
+ 5.52% ip [kernel.kallsyms] [k] memcpy_erms
+ 4.76% ip [kernel.kallsyms] [k] __alloc_skb
+ 4.54% ip [kernel.kallsyms] [k] vsnprintf
+ 3.94% ip [kernel.kallsyms] [k] format_decode
+ 3.80% ip [kernel.kallsyms] [k] kmem_cache_alloc_node_trace
+ 3.71% ip [kernel.kallsyms] [k] kmem_cache_alloc_node
+ 3.66% ip [kernel.kallsyms] [k] kobject_uevent_env
+ 3.38% ip [kernel.kallsyms] [k] strlen
+ 2.65% ip [kernel.kallsyms] [k] _raw_spin_lock_irqsave
+ 2.20% ip [kernel.kallsyms] [k] kfree
+ 2.09% ip [kernel.kallsyms] [k] memset_erms
+ 2.07% ip [kernel.kallsyms] [k] ___cache_free
+ 1.95% ip [kernel.kallsyms] [k] kmem_cache_free
+ 1.91% ip [kernel.kallsyms] [k] _raw_read_lock
+ 1.45% ip [kernel.kallsyms] [k] ksize
+ 1.25% ip [kernel.kallsyms] [k] _raw_spin_unlock_irqrestore
+ 1.00% ip [kernel.kallsyms] [k] widen_string
+
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Michal Kubecek <mkubecek@suse.cz>
+
+---
+ lib/kobject_uevent.c | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+--- a/lib/kobject_uevent.c
++++ b/lib/kobject_uevent.c
+@@ -174,18 +174,12 @@ static int kobject_uevent_net_broadcast(struct kobject *kobj,
+ skb = alloc_skb(len + env->buflen, GFP_KERNEL);
+ if (skb) {
+ char *scratch;
+- int i;
+
+ /* add header */
+ scratch = skb_put(skb, len);
+ sprintf(scratch, "%s@%s", action_string, devpath);
+
+- /* copy keys to our continuous event payload buffer */
+- for (i = 0; i < env->envp_idx; i++) {
+- len = strlen(env->envp[i]) + 1;
+- scratch = skb_put(skb, len);
+- strcpy(scratch, env->envp[i]);
+- }
++ skb_put_data(skb, env->buf, env->buflen);
+
+ NETLINK_CB(skb).dst_group = 1;
+ retval = netlink_broadcast_filtered(uevent_sock, skb,
diff --git a/series.conf b/series.conf
index 5622190827..7d75fd0e89 100644
--- a/series.conf
+++ b/series.conf
@@ -8764,6 +8764,7 @@
patches.drivers/net-mvpp2-remove-useless-goto.patch
patches.fixes/bpf-Implement-map_delete_elem-for-BPF_MAP_TYPE_LPM_T.patch
patches.fixes/kobject-add-kobject_uevent_net_broadcast.patch
+ patches.fixes/kobject-copy-env-blob-in-one-go.patch
patches.drivers/cxgb4-add-new-T5-pci-device-id-s-34929cb4.patch
patches.drivers/drivers-net-e1000e-use-setup_timer-helper.patch
patches.drivers/drivers-net-bnxt-use-setup_timer-helper.patch