Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp250072ybk; Tue, 19 May 2020 21:38:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy26hrdQTb+fjQJk7JDUP8NLw4wnMFBn8bqvNqBp3Or8Ur8UcVTGWziEvd5agvY0pbvfffg X-Received: by 2002:a17:906:9605:: with SMTP id s5mr2357007ejx.135.1589949518645; Tue, 19 May 2020 21:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589949518; cv=none; d=google.com; s=arc-20160816; b=ECiXxJ5B91mw6+5Ym+kvexYNeirkwmbcjeqtZ3vYOLPlanRagD7E5n0FQL1uZ5PoRl t+xOxcM11bp59/bcMsnYRJoQoyN/fG5ku6e+gtNtWvhxJ2Mz89Nc8w0/vDIFzH2i72tr KUwRbO+32nWMEzRC3OBQlnpv12R1jXXWZ/q6+Vvw4isJB2F36jPngIweb8u+zEw3+yk0 V93yzJQryHmsJPb/6O7Trok2Q+wLi0mQ0AmN/cOowFcAVRR2SVPUbQutpZquIHRxqFU+ 691QfZEY1OLTafo0c7jIz6NgRHa/ehbiJotd/AbrwNjnRiuvGDZTkAvXpsR65j4nQgZ/ Hjcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=z18eUcX9wumqAi1dZD97mqpztrpNBRW0eHw97u6ixxM=; b=uFA3rP59JMn8cuAvsvf/zloE4mT6UMhJNBdO3+xuecZRPQPYVk3kWnGVZQJSXo9KcY q21FBi0VAZNNI63xfO6nzsbtzFqXMFqnHqJiTAQn9Ra8uSkU05ZhK0BCiMFB0s9Wr2fF oAjvwEkBqsYkWCcbJek8CpHBK1kiZwz4YoDhDHlrZ2C2ZYWkj9yMuMBRUkY012wYsfha Hy/MQ+aasqLE5g1+J7bJX2/2m7jSESEgeT5P7skQegZ2uJqCiunkQXQ61zu118dPI+pf ELiEct9UFX2v25jwJuHHpc0t+aqp2cflt9jaEYWjqm/l9iP7xQvyJ59sKAkX6rsIz/G5 pd0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b="hnmvyk/M"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r27si1022092ejb.750.2020.05.19.21.38.16; Tue, 19 May 2020 21:38:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b="hnmvyk/M"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726738AbgETEgn (ORCPT + 99 others); Wed, 20 May 2020 00:36:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726566AbgETEgn (ORCPT ); Wed, 20 May 2020 00:36:43 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D54C6C061A0E for ; Tue, 19 May 2020 21:36:42 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id d10so867985pgn.4 for ; Tue, 19 May 2020 21:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z18eUcX9wumqAi1dZD97mqpztrpNBRW0eHw97u6ixxM=; b=hnmvyk/M83EsgHOqYGveBP5/xO9sKSMWadm584PNwZy+/Oph7HoRx8Ln2sEpjLU5qw xOWTiT2CEAUODRkg1aJNaUdrmEp3/fYLwuouPPQWxotBxYF6+pHp7Cvl3nkJxxLjT9JZ abO018U4u4MauIzN8h07kT81+XaoZl/+wOQAtMHPMqQ38OmBmBVRZCnDzPPl4vZxll9+ urzIGK9Rx0rocxi/lsOK5HoPZbjGFO2mAyAhr8EvTdewc9sWCs6MgBNsfv2ZQT6/c4qk EEdgKI4X3/EtLJO7fnn/a/+meJ7+T5jaU8pNhnU02fr94zN+/I4ID5W6KR0y1fSmcawM sxiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z18eUcX9wumqAi1dZD97mqpztrpNBRW0eHw97u6ixxM=; b=aeITk1zJsf3vuRMjPuzNdeaSDljdGh1nRg1sunpmKaGW7GtRYoFbFdEziWGb7E3uAl ZoySc0cLckecCeT5f+a1+y/GBMR/hJFpIfRUIxq+85fAvIfAnnPfIXiO55NkboBvBNlK hTAkGHl8tppo7P52i2zuAnBH8lMmuwft1WyTmEIWRiyodk8ddTEXSRcbU/YWuzpzrSiz n3jNuZjnZOwp8P+qFRj6Mo/M232jRWr0+joKoih4L26+/yjXrtgwFoKZyacylWeRBPne WsIlkQDqs7tA/KGme5aghPsp9Qcfarc5NUqAyAUt9PWPLvjREMUv/HqtICxL64yiVrjf injw== X-Gm-Message-State: AOAM532+4vhZFoUOT4gnqoJBt/mAZKueJ4LPX+EvyTK0QPkhd634ApAp G8edzdEIAv50IsVD4igh74faew== X-Received: by 2002:a62:7996:: with SMTP id u144mr2368896pfc.86.1589949402274; Tue, 19 May 2020 21:36:42 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id y10sm876007pfb.53.2020.05.19.21.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 21:36:41 -0700 (PDT) Date: Tue, 19 May 2020 21:36:37 -0700 From: Stephen Hemminger To: Eric Dumazet Cc: David Miller , tglx@linutronix.de, a.darwish@linutronix.de, peterz@infradead.org, mingo@redhat.com, will@kernel.org, paulmck@kernel.org, bigeasy@linutronix.de, rostedt@goodmis.org, linux-kernel@vger.kernel.org, kuba@kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v1 01/25] net: core: device_rename: Use rwsem instead of a seqcount Message-ID: <20200519213637.4d874aad@hermes.lan> In-Reply-To: <886041df-d889-3d88-59fe-e190d15f9c98@gmail.com> References: <87v9kr5zt7.fsf@nanos.tec.linutronix.de> <20200519161141.5fbab730@hermes.lan> <87lfln5w61.fsf@nanos.tec.linutronix.de> <20200519.195722.1091264300612213554.davem@davemloft.net> <886041df-d889-3d88-59fe-e190d15f9c98@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 May 2020 20:18:19 -0700 Eric Dumazet wrote: > On 5/19/20 7:57 PM, David Miller wrote: > > From: Thomas Gleixner > > Date: Wed, 20 May 2020 01:42:30 +0200 > > > >> Stephen Hemminger writes: > >>> On Wed, 20 May 2020 00:23:48 +0200 > >>> Thomas Gleixner wrote: > >>>> No. We did not. -ENOTESTCASE > >>> > >>> Please try, it isn't that hard.. > >>> > >>> # time for ((i=0;i<1000;i++)); do ip li add dev dummy$i type dummy; done > >>> > >>> real 0m17.002s > >>> user 0m1.064s > >>> sys 0m0.375s > >> > >> And that solves the incorrectness of the current code in which way? > > > > You mentioned that there wasn't a test case, he gave you one to try. > > > > I do not think this would ever use device rename, nor netdev_get_name() > > None of this stuff is fast path really. > > # time for ((i=1;i<1000;i++)); do ip li add dev dummy$i type dummy; done > > real 0m1.127s > user 0m0.270s > sys 0m1.039s Your right it is a weak test, and most of the overhead is in the syscall and all netlink events that happen. It does end up looking up the new name, so would exercise that. Better test is to use %d syntax or create 1000 dummy's then rename every one. This is more of a stress test # for ((i=0;i<1000;i++)); do echo link add dev dummy%d type dummy; done | time ip -batch - 0.00user 0.29system 0:02.11elapsed 13%CPU (0avgtext+0avgdata 2544maxresident)k 0inputs+0outputs (0major+148minor)pagefaults 0swaps # for ((i=999;i>=0;i--)); do echo link set dummy$i name dummy$((i+1)); done | time ip -batch - 0.00user 0.26system 0:54.98elapsed 0%CPU (0avgtext+0avgdata 2508maxresident)k 0inputs+0outputs (0major+145minor)pagefaults 0swaps