Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1497174lqe; Mon, 8 Apr 2024 10:26:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWWA/p58UNzqjizOOgEByO2s3OgZVSeREfQCTn2GGvce+jI/HUMrvhLHIGqQn5zhP85v7gCJH5mG7AbRJP+OIixEhRDp2Gf/6Px4bUVKA== X-Google-Smtp-Source: AGHT+IHpLiGdQhH5JS2AJVmChfoAEC5ZQTZo3dHAnBOHqrDafnv9qFeIg+FqZMZcp1QJpPMBmr+J X-Received: by 2002:a50:baec:0:b0:56e:241c:3f3d with SMTP id x99-20020a50baec000000b0056e241c3f3dmr7465835ede.25.1712597184839; Mon, 08 Apr 2024 10:26:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712597184; cv=pass; d=google.com; s=arc-20160816; b=pPnWTBKL87IxlpR6OmDb725ckLqH4CluJYCkWuea2dOY9bH5aFJmpYjdGjZ6mkqNdx FxYR6W9On9svSZyF+3Yrl5LeqipMJgX4hhnAOTYVKT9kBM6na+YtjOqeEheFkv1IxsR5 xDV/xJAU2e5dfE2mkRFscNCeJy2bvr6xBy0jeNn7Fz7eBI7BwMBSTdWOF731Z1E1BHYT qXT9wmLdxMZx1a+tZ683HIBWUo07QVgwxIX8Kk/oDxTLqX8WlBxoSw21ga8JxoZjjj5v XKGxj/cpoX540wN5zey8YgCkxUdl1UjTn9tnHe0KX5ScQf3rQRNDIhzXOPSgA95hybwL 5KiA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=fXqKi997L3PagciIuldmRmvr0R9pdf27i5jWxsqbl7k=; fh=X1nbfrBZsKuPYEJfnH8pDIADhlgsOuvZ3bAkIA2j4hs=; b=l4uZONh9MEa2yoWTTJ0tDHSvvRcenJ1mkOqNNt64vCVLoGHLuLeQZ9j/1R+5v7HSRx Hd0Ga3nsAJRwYmKZrvuRQSCPqnbA6YFcngO8J1GrVOJ5og7jnwYhBz4topcO4MEayjuj rOxDLfNnPp/+Lb2eXo6qewO/0iRBUcr0KD9SobUn0DvEvxGP87OiBpAGetq1mIP+/OoB tCNGF6VWe50JmgRlaGFi4rX9BD1+n1JvLWuDbwnu6Mv03DUuRFep31csyQkVbiW1cmua ZY0ScaQ7BaIolIYQUDX2QS1bQyWqbexf+FGzEEo2fORxLRwktw5/ACmzn/36tY5jUbPr Fk0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-135745-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135745-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q23-20020a50aa97000000b0056e2c9b694dsi3774009edc.109.2024.04.08.10.26.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 10:26:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135745-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-135745-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135745-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 625C01F2774F for ; Mon, 8 Apr 2024 17:26:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 453B5143C5B; Mon, 8 Apr 2024 17:26:16 +0000 (UTC) Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (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 1DD247460; Mon, 8 Apr 2024 17:26:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712597175; cv=none; b=p04EzlOcwJ4/v/HyUA/iFt8GxRo5nXF6/tG6nXefAfuobvmYRANcOZFE//cbq2DqHfrGfLQL8Od3qZG+okZPAn0U7sPumNtHrPDujxYziSa1rGyd/0IMZFpSyEaPAduxqAvwxommohqY2NOncX7WsOoo6XH+/VN5GK7anauoTbs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712597175; c=relaxed/simple; bh=7kdOk4ITZylKnr8pBP2i71I3BILRIe0aVqKcpr7nQas=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=K5iTq5buceSZ/E+bLA/5ncHDF+H23bJiO8h2Hj5lu1jfx2EiTj/WhpybDXc7J+LsjMjFcYgklfstwW1FyOBxeTMordpo+xvhPIsMmgnhKcS6T7yoWmVOyS+f1uEZ9nHsjcVdFIP7QMI5SuxHQf0/5fS63/9195JiBcTqV8SWVeo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.208.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-56e69888a36so1249582a12.3; Mon, 08 Apr 2024 10:26:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712597172; x=1713201972; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fXqKi997L3PagciIuldmRmvr0R9pdf27i5jWxsqbl7k=; b=w9xEG/coOOMLYe+jeECThqKMU4bgc8/BdU/UfeUk0KOoJI4Z6kt//ZSpjN7/MgJvlP KPO217y9eJUyxRjwT7bsxPxXtgP3jDV3SxePXRqzUztaPudU040mH5pCcU3rtmHBrf9L Sy9vPodStIllrl+AfKOfj4/opitMfGlrSt9Xb4zHu4w92OhieHFHyiIBq2UF+eSqOG+2 dJeROkT4I63LZXPMOy4eKp0EkqBq+NvrJHR3XuzSLVcYdUt7CW/uQGakYO95wNp4RwnU b9+4Henlo7isza0YUkpfI+xzg4a90M8DAPKGOmrDKzmLozdEZQyk1TZnYMDLUlYxJwrC KnDQ== X-Forwarded-Encrypted: i=1; AJvYcCWJ9fOgyk8+MEXICzBGXDqP5+qVZ7uIg4f+GbUbCENDxRfqQKSjKag4oGPBUpVu5NqZPrsElyg18Jjg8CBpSiVqSUeW/pLD X-Gm-Message-State: AOJu0YwSJ8K1XuUMf79VQtJiLuCKbVIGugcr88kv2+cmO8XY0yOnM6aG 90dO2tCZ4tjiK3F0dsYHwKrse+omLMfP/DXBGxUUktmPJ9xMhaKs X-Received: by 2002:a17:906:cd03:b0:a47:4a32:604 with SMTP id oz3-20020a170906cd0300b00a474a320604mr6100227ejb.26.1712597172180; Mon, 08 Apr 2024 10:26:12 -0700 (PDT) Received: from localhost (fwdproxy-lla-001.fbsv.net. [2a03:2880:30ff:1::face:b00c]) by smtp.gmail.com with ESMTPSA id dr2-20020a170907720200b00a4ea1fbb323sm4645341ejc.98.2024.04.08.10.26.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 10:26:11 -0700 (PDT) From: Breno Leitao To: kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com, edumazet@google.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 0/4] net : dqs: optimize if stall threshold is not set Date: Mon, 8 Apr 2024 10:25:52 -0700 Message-ID: <20240408172605.635508-1-leitao@debian.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Here are four patches aimed at enhancing the Dynamic Queue Limit (DQL) subsystem within the networking stack. The first two commits involve code refactoring, while the third patch introduces the actual change. The fourth patch just improves the cache locality. Typically, when DQL is enabled, stall information is always populated through dql_queue_stall(). However, this information is only necessary if a stall threshold is set, which is stored in struct dql->stall_thrs. Although dql_queue_stall() is relatively inexpensive, it is not entirely free due to memory barriers and similar overheads. To optimize performance, refrain from calling dql_queue_stall() when no stall threshold is set, thus avoiding the processing of unnecessary information. Changelog: v1: * https://lore.kernel.org/all/20240404145939.3601097-1-leitao@debian.org/ v2: * Moved the stall_thrs to the very first cache line, as a new patch. Suggested by Eric Dumazet. Breno Leitao (4): net: dql: Avoid calling BUG() when WARN() is enough net: dql: Separate queue function responsibilities net: dql: Optimize stall information population net: dqs: make struct dql more cache efficient include/linux/dynamic_queue_limits.h | 50 +++++++++++++++++----------- 1 file changed, 30 insertions(+), 20 deletions(-) -- 2.43.0