From patchwork Wed Feb 14 08:48:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 20357 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp1075154dyb; Wed, 14 Feb 2024 00:48:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWdjDyeViUGpTmoNkOwLGTa5qHWiV+sYZAwF9BOHzQI/5O2mCCscWtCT5Rcmp8r6xgTt2VHbK65hrmw3pBM6by6+hT4RA== X-Google-Smtp-Source: AGHT+IGgEKJHuqc00Yv9aOOpJ13FJ41n74O8D2Ahpty0JDBe3qx99TLhpCBVbizIHizt33Qa6Adt X-Received: by 2002:a05:6358:b00d:b0:176:40d5:2bd5 with SMTP id l13-20020a056358b00d00b0017640d52bd5mr1979750rwn.6.1707900539387; Wed, 14 Feb 2024 00:48:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707900539; cv=pass; d=google.com; s=arc-20160816; b=fHK9S5VdhpOUXda/F+TH6/T4isYaUBY9xVWukqUAEowLGXbdikvbheH4PlqDYL1UpI ck4AjXKOmNS+Ik2LTx/j06W3hIhjfQBZx1P/BSXe6yjkwe+KsQcpIiMPDKFg/VXSANKb kxjlYgngh2Hd75RkFr3ZWDEgzA1O/29SEK0wnd1TZplkv0QKbTAFRELF9QNR/+HKpOQu BD5JANRDCpRj0QURqb3P0dg6HWluIwfGm5I3338Roi5ojrnBZq0s/Ss9ZbymtVHw8mOG +hcJ+fs5nXizA8MtXzUE/njGSb9cX5hHCiZvstqv0HsBiOk+FPlPFvL3BFal8Jlwv7J5 OXAA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=VnZBAXHHBHi7NJ95r/XBvn9wLkNSo/WMgRYmbP1bpJM=; fh=HYocDNnma4IeHUXxXUWTLjQgR76tP1dP5zM3nhSYDpQ=; b=N5qUqaTpwoOymG8GJjPIpMHKUvHBDT+KAYQeB2wIApbGyG3c8otLMT4wDMFHXSDq/c 5F0XVPjemDHiSIOt81bh1+vjztqgLji4v+oGg78zO9A8qx+EwHewPxzXH5QNd/a89oY2 D4qO2RvchMjhuEXPWYwpee56dOprGXvWyIeOZn2ZF9VJZiQQX46sCW3zeUJ7LvFbeZjo /gtGxIno746Tl03JW3y7vofmV+JV4OwJ+odu1FB4qk+Zzu8idV2PBnzt+2UO21nUlPXM 0epMPvQ9sLJ+cMCtRyzWp6IPqX2tPE/3s5Y5cjfn337DoqKSm83mRZMnOIPHte12QLEX H9xg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=tFEFahoq; arc=pass (i=1 spf=pass spfdomain=flex--edumazet.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-64882-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64882-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCXut9PbHaDPrPGDSUemkfvDykALFmsWwTLOEMXWD20XTNC7VJd6KiwWu1E3CnKQGouOT7vFuwN47xmi4Xpu7dSmcGpmMw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o23-20020a637e57000000b005d5c89bd684si3462461pgn.414.2024.02.14.00.48.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 00:48:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64882-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=tFEFahoq; arc=pass (i=1 spf=pass spfdomain=flex--edumazet.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-64882-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64882-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2717628B235 for ; Wed, 14 Feb 2024 08:48:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF3EFD2E6; Wed, 14 Feb 2024 08:48:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tFEFahoq" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE7376FAD for ; Wed, 14 Feb 2024 08:48:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707900514; cv=none; b=hkIocTMUG7g1FDGyq/m0ckE87VhzX0D8EuBsEpShvdyFAe2qdZdnEvi+K1TK8hdn3NEe01z3X8+iU5hQUA1oBR8w5TUNvjxRPz0x8dC8ggyJJtH6382y1F9+TF6PFpuH5aP/GADbKT+9ApAKa0wrlL4JMRLgzAA0+Yi5NkvPtlc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707900514; c=relaxed/simple; bh=tb/rHH7nD+tvYMzZ/pXuxRJUhft+UD56HAU8GYSKNVA=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=Me1FLIpZCSfkwGIVkRBqv4Qnms5a4cH4wpB4GcU97xFDkjAg8zid2ZVGGrr4ywwG5aof1cB7btN+wAcqW7C5HQ/tehaWS+9uCZhPznnHiDTKfEmKqqrFfZ4PSf67GP0SRj0Z6CISMGX7JBCazpMCeoL0gMxUdU1L0JjLlvxnO98= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=tFEFahoq; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-dc6b26845cdso9047641276.3 for ; Wed, 14 Feb 2024 00:48:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707900512; x=1708505312; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=VnZBAXHHBHi7NJ95r/XBvn9wLkNSo/WMgRYmbP1bpJM=; b=tFEFahoqv9sXFSjlZ/8B2OECr83kr9wjocte71kUY4h7pe7u/cYeRCa2kvFHCuOse2 CZCxU8PXKkVJGwY+30i1C36UUQKiB32D5H5LKJADd5NgFGkq8KEqgiRBE8hyMx+55uj3 ldWppqcVrlMm1x2x7Ukhz9ykAY6ik+PT3mY1oj73qv4v2wBkjdqNeyXRsmM6laZ1zLnX 2j2biGtQLOjuPlNn/2MYscIh+8K+0xQrE9GH+4d9JCsKjpK7XeBW2V9kBouOaRzwGA2Y cQTZF4PaAL539gZQGGudFguYHzPk6CFk4qlDbYK9gpYJ2CO+E5MEqQcKmLrqGwXdxQwq qLzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707900512; x=1708505312; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=VnZBAXHHBHi7NJ95r/XBvn9wLkNSo/WMgRYmbP1bpJM=; b=NQkiq41EXJtaXuLu6swg2LZFlNX/1jqno2PniE2lcV2a0r+FeU85XQneHEcZZqyf1K CCS6oQe4kwXviScvW3PkmiLiSyp1Axwjz3sToqNaMQWPIe2V4whxReakdz5M041wSexh rcsirOOkC2acps1fk93eCoQLGrqPLohSrXhrUT9O/B/bP1/8GgtnnE6a41uPfxvGu43v 3HqHtPQAhoUIAkDqkh4hai7M4HPjAc4PR8llQ8nBvMQi7QwXJjVxjsfvhkx7B/klCCKi 8xtWUTCulD6qaSKHXToDPCoaVkyuDSZp+5/zNGkxmd3e3V7Z+ATrw6qqboErx4EH6eOk v9+Q== X-Gm-Message-State: AOJu0YxK34DA92raV+IuFJqwvWrDv0wshdXjD+Cd7dxTtOtjYiH/7cyY d9otphDMKCIWUSeuOoXociNRdOEv7FS8UJNnq1roxvl7XeJsRgZ7QsljgHYvSBsAA1a6HFQDK+W ROnEw9C4isA== X-Received: from edumazet1.c.googlers.com ([fda3:e722:ac3:cc00:2b:7d90:c0a8:395a]) (user=edumazet job=sendgmr) by 2002:a05:6902:1007:b0:dc9:5ef8:2b2d with SMTP id w7-20020a056902100700b00dc95ef82b2dmr453013ybt.4.1707900511818; Wed, 14 Feb 2024 00:48:31 -0800 (PST) Date: Wed, 14 Feb 2024 08:48:27 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.687.g38aa6559b0-goog Message-ID: <20240214084829.684541-1-edumazet@google.com> Subject: [PATCH 0/2] kobject: reduce uevent_sock_mutex contention From: Eric Dumazet To: Greg Kroah-Hartman , Christian Brauner Cc: linux-kernel , "Rafael J . Wysocki" , Andrew Morton , netdev@vger.kernel.org, "David S . Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , Eric Dumazet X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790863515854682356 X-GMAIL-MSGID: 1790863515854682356 This series reduces the (small ?) contention over uevent_sock_mutex, noticed when creating/deleting many network namespaces/devices. 1) uevent_seqnum becomes an atomic64_t 2) Only acquire uevent_sock_mutex whenever using uevent_sock_list Eric Dumazet (2): kobject: make uevent_seqnum atomic kobject: reduce uevent_sock_mutex scope include/linux/kobject.h | 2 +- kernel/ksysfs.c | 2 +- lib/kobject_uevent.c | 24 +++++++++++------------- 3 files changed, 13 insertions(+), 15 deletions(-)