Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/815098/?format=api
{ "id": 815098, "url": "http://patchwork.ozlabs.org/api/1.2/patches/815098/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170918190733.26272-4-edumazet@google.com/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/1.2/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170918190733.26272-4-edumazet@google.com>", "list_archive_url": null, "date": "2017-09-18T19:07:29", "name": "[net-next,3/7] kobject: factorize skb setup in kobject_uevent_net_broadcast()", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "0037a471619a2d6302d9894eecca4d513c040863", "submitter": { "id": 13357, "url": "http://patchwork.ozlabs.org/api/1.2/people/13357/?format=api", "name": "Eric Dumazet", "email": "edumazet@google.com" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/1.2/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170918190733.26272-4-edumazet@google.com/mbox/", "series": [ { "id": 3713, "url": "http://patchwork.ozlabs.org/api/1.2/series/3713/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=3713", "date": "2017-09-18T19:07:26", "name": "net: speedup netns create/delete time", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/3713/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/815098/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/815098/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=google.com header.i=@google.com\n\theader.b=\"ZlRLaOkq\"; dkim-atps=neutral" ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xwwWB32wPz9s7G\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 19 Sep 2017 05:07:50 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751300AbdIRTHr (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 18 Sep 2017 15:07:47 -0400", "from mail-pg0-f42.google.com ([74.125.83.42]:56448 \"EHLO\n\tmail-pg0-f42.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751024AbdIRTHo (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 18 Sep 2017 15:07:44 -0400", "by mail-pg0-f42.google.com with SMTP id 7so643672pgd.13\n\tfor <netdev@vger.kernel.org>; Mon, 18 Sep 2017 12:07:44 -0700 (PDT)", "from localhost ([2620:15c:2cb:201:1d19:43e0:8828:6785])\n\tby smtp.gmail.com with ESMTPSA id\n\ts189sm240084pgc.1.2017.09.18.12.07.43\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tMon, 18 Sep 2017 12:07:43 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=google.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=UCjNv14loWryZHzP6fMc+WnLfVd2FEtiNpphKJSG95Y=;\n\tb=ZlRLaOkqZVM0b9FO11uuB0O92y98WnDHT4TQIOb95oZkEsak+0mb9O7NGhKBGlUesz\n\tHAXfCQr14eRvK8KuMdCdSWjOsvwrvpUA0EYgD1a7qQO01A4IGZMyFQDeKABMHddkBS34\n\t9N1PmBfejdzFyEYHHMtI588/EaYiXahWjnkbfiA8ghE2J1lmgkSX+JUMnY5Ga+qHN6IL\n\tIot15K8gx04oXNJManHzHr+v+04fv9BZ3Ydly5xpRFfRXiX5hQGLYDQHHNgEfNNsBmdr\n\tdhbvZb4BLKtlqcZldUsueZvcN+B+SBzn4TdMej2YH9dvJaK9DqZBEvsabP9lnKlYmoeV\n\tUpRQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=UCjNv14loWryZHzP6fMc+WnLfVd2FEtiNpphKJSG95Y=;\n\tb=s4jVQd3twSdq6aG6LOH+6BW9Oj1uFTUaFCvqggSvRnaDXzk2rfGwcmacQv5OofiO3m\n\tJVerZW2c64ykDfK9qpiQsNMEHHU1sxdXP9pAbzAI37Wt1u56ZPj+PGTnAU+97uSuvmUQ\n\trKj1jij95jyun5mxNhOyFye8PTP3Gs/L499f5dyRpLwM8Zw5P19pz6VKyXrbajDY8F3L\n\t4AocKBln5x0l9AmqGaFbRSeACR5Y08DQzp/vzCg8Gj4cak83NIchDm50d6LmJzWeN2P6\n\t39hmUwND+zC3V1YHXscu/qfJK4H3KbFR+7fwRTiBMEljTrb5NyDvlT3SoJT4ntYOjmT6\n\th34A==", "X-Gm-Message-State": "AHPjjUgg4Qhq394c36Qrk8uIENRDP8hOOx86HPtklw2fcUmmhsllh5/s\n\tymRuwczsXlPSS8QNUqxl4A==", "X-Google-Smtp-Source": "ADKCNb7KXr/i5HylUaQh1yeHTZ8Bq4abUWzrPVQZTB1UbsThQOgzGL9vDSeMrT0opr/CGHW3hTI5xA==", "X-Received": "by 10.99.182.78 with SMTP id v14mr34275133pgt.325.1505761664268; \n\tMon, 18 Sep 2017 12:07:44 -0700 (PDT)", "From": "Eric Dumazet <edumazet@google.com>", "To": "\"David S . Miller\" <davem@davemloft.net>", "Cc": "netdev <netdev@vger.kernel.org>,\n\t\"Eric W . Biederman\" <ebiederm@xmission.com>,\n\tEric Dumazet <edumazet@google.com>, Eric Dumazet <eric.dumazet@gmail.com>", "Subject": "[PATCH net-next 3/7] kobject: factorize skb setup in\n\tkobject_uevent_net_broadcast()", "Date": "Mon, 18 Sep 2017 12:07:29 -0700", "Message-Id": "<20170918190733.26272-4-edumazet@google.com>", "X-Mailer": "git-send-email 2.14.1.690.gbb1197296e-goog", "In-Reply-To": "<20170918190733.26272-1-edumazet@google.com>", "References": "<20170918190733.26272-1-edumazet@google.com>", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "We can build one skb and let it be cloned in netlink.\n\nThis is much faster, and use less memory (all clones will\nshare the same skb->head)\n\nTested:\n\ntime perf record (for f in `seq 1 3000` ; do ip netns add tast$f; done)\n[ perf record: Woken up 1 times to write data ]\n[ perf record: Captured and wrote 4.110 MB perf.data (~179584 samples) ]\n\nreal 0m24.227s # instead of 0m52.554s\nuser 0m0.329s\nsys 0m23.753s # instead of 0m51.375s\n\n 14.77% ip [kernel.kallsyms] [k] __ip6addrlbl_add\n 14.56% ip [kernel.kallsyms] [k] netlink_broadcast_filtered\n 11.65% ip [kernel.kallsyms] [k] netlink_has_listeners\n 6.19% ip [kernel.kallsyms] [k] _raw_spin_lock_irqsave\n 5.66% ip [kernel.kallsyms] [k] kobject_uevent_env\n 4.97% ip [kernel.kallsyms] [k] memset_erms\n 4.67% ip [kernel.kallsyms] [k] refcount_sub_and_test\n 4.41% ip [kernel.kallsyms] [k] _raw_read_lock\n 3.59% ip [kernel.kallsyms] [k] refcount_inc_not_zero\n 3.13% ip [kernel.kallsyms] [k] _raw_spin_unlock_irqrestore\n 1.55% ip [kernel.kallsyms] [k] __wake_up\n 1.20% ip [kernel.kallsyms] [k] strlen\n 1.03% ip [kernel.kallsyms] [k] __wake_up_common\n 0.93% ip [kernel.kallsyms] [k] consume_skb\n 0.92% ip [kernel.kallsyms] [k] netlink_trim\n 0.87% ip [kernel.kallsyms] [k] insert_header\n 0.63% ip [kernel.kallsyms] [k] unmap_page_range\n\nSigned-off-by: Eric Dumazet <edumazet@google.com>\n---\n lib/kobject_uevent.c | 34 +++++++++++++++++++---------------\n 1 file changed, 19 insertions(+), 15 deletions(-)", "diff": "diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c\nindex cb5102d638452ea6c03d12e61ea8c55c9dd72675..05166f3a2528f2aa915405675c6662579e67de52 100644\n--- a/lib/kobject_uevent.c\n+++ b/lib/kobject_uevent.c\n@@ -301,23 +301,26 @@ static int kobject_uevent_net_broadcast(struct kobject *kobj,\n {\n \tint retval = 0;\n #if defined(CONFIG_NET)\n+\tstruct sk_buff *skb = NULL;\n \tstruct uevent_sock *ue_sk;\n \n \t/* send netlink message */\n \tlist_for_each_entry(ue_sk, &uevent_sock_list, list) {\n \t\tstruct sock *uevent_sock = ue_sk->sk;\n-\t\tstruct sk_buff *skb;\n-\t\tsize_t len;\n \n \t\tif (!netlink_has_listeners(uevent_sock, 1))\n \t\t\tcontinue;\n \n-\t\t/* allocate message with the maximum possible size */\n-\t\tlen = strlen(action_string) + strlen(devpath) + 2;\n-\t\tskb = alloc_skb(len + env->buflen, GFP_KERNEL);\n-\t\tif (skb) {\n+\t\tif (!skb) {\n+\t\t\t/* allocate message with the maximum possible size */\n+\t\t\tsize_t len = strlen(action_string) + strlen(devpath) + 2;\n \t\t\tchar *scratch;\n \n+\t\t\tretval = -ENOMEM;\n+\t\t\tskb = alloc_skb(len + env->buflen, GFP_KERNEL);\n+\t\t\tif (!skb)\n+\t\t\t\tcontinue;\n+\n \t\t\t/* add header */\n \t\t\tscratch = skb_put(skb, len);\n \t\t\tsprintf(scratch, \"%s@%s\", action_string, devpath);\n@@ -326,16 +329,17 @@ static int kobject_uevent_net_broadcast(struct kobject *kobj,\n \t\t\tmemcpy(scratch, env->buf, env->buflen);\n \n \t\t\tNETLINK_CB(skb).dst_group = 1;\n-\t\t\tretval = netlink_broadcast_filtered(uevent_sock, skb,\n-\t\t\t\t\t\t\t 0, 1, GFP_KERNEL,\n-\t\t\t\t\t\t\t kobj_bcast_filter,\n-\t\t\t\t\t\t\t kobj);\n-\t\t\t/* ENOBUFS should be handled in userspace */\n-\t\t\tif (retval == -ENOBUFS || retval == -ESRCH)\n-\t\t\t\tretval = 0;\n-\t\t} else\n-\t\t\tretval = -ENOMEM;\n+\t\t}\n+\n+\t\tretval = netlink_broadcast_filtered(uevent_sock, skb_get(skb),\n+\t\t\t\t\t\t 0, 1, GFP_KERNEL,\n+\t\t\t\t\t\t kobj_bcast_filter,\n+\t\t\t\t\t\t kobj);\n+\t\t/* ENOBUFS should be handled in userspace */\n+\t\tif (retval == -ENOBUFS || retval == -ESRCH)\n+\t\t\tretval = 0;\n \t}\n+\tconsume_skb(skb);\n #endif\n \treturn retval;\n }\n", "prefixes": [ "net-next", "3/7" ] }