Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2802825lqp; Mon, 25 Mar 2024 09:34:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMHgBGUbtT5sRetuhpoRukJJP6siY3BBR2KG/UTPlKQua0w+Wf+OLihLlIJtKmVxnmSoD/RvD7RcWLDaojX6UyFhF++umU/1dvkdFVoA== X-Google-Smtp-Source: AGHT+IEzEj3S/IrqV2816u5+WzP5RA7Uav3l55V2Sh0E8YZ7jTt975ulxnZVtfzcwnarnE9uB90K X-Received: by 2002:a17:902:d482:b0:1dd:e115:336c with SMTP id c2-20020a170902d48200b001dde115336cmr8933673plg.69.1711384490410; Mon, 25 Mar 2024 09:34:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711384490; cv=pass; d=google.com; s=arc-20160816; b=X9pJONiX/xRZeo0JiLiBjMrL3IW6es1G47dsFYtnyJW1ApwCqdIslSGnvO1s/tdzxm b6VPv7nCm4ArThTlIJdQqh5ANd0bagOhLoUgzUKZ/80EDwV69XvV2RstEbdwbMp5PSMy mbf5TtVJTaxCmaVa6o7YDkrkX05iEqezG7hSlFejUNFqrUIdqOficAIG7w4Ho5Oi3f14 B5bbLzz8PB1seLEeJgN4O+AwslSkzxehuHV0HiI4/xkfRiL/kLltX9dRAgz5+Fu4iHZ8 PYMXoBik14PZo0mlKE+TEEBrvWmBOhgVd/JzS9tRXFPnjwJYJV/gW6M5D0YSNoxC+HzN lrWA== 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:dkim-signature; bh=7licXzL4httiCp5hSTNrvtPUOGc2UkcCW0a7xMc5f/8=; fh=0ZKV22Mpi0Z+/zRlCC9GRUAKl0wLMxmYgR1nXO1NAEs=; b=dcCXEYvnr0IUcQpGg26qc32iG7W7kBF/oCgSeRHM1HgOhPKmYzBWrs/XdDhszJZG9D N8RfFdJwg6vNUD9hNnWodWS+zHyCU3NXy7J0RR5HDh/uLfDgwMtECNvAV1itNvN4gIla kHN7Mq+/NKzcpNMESDlXvYu9sRGoUjujk7cBzUvFbbsxpAzZQPjYjavioeEXc3wRySve P9ERl6S5vxoWry79tUJDQH6lFyKi/3jtr8NuZCnr2gpShmXUXhvdceNzuCOAOgJXvfMp CZxzekaFzOY265n/nuLslRkG+MRdpHXl1LJjRJOxXNfQzW14Xqf2zTgsmcitC1EcK9r9 fj9g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=RHqU7EcY; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-5197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5197-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e8-20020a170902784800b001dffdf223d4si5150409pln.105.2024.03.25.09.34.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 09:34:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=RHqU7EcY; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-5197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5197-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net 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 4E01F3424C0 for ; Mon, 25 Mar 2024 16:13:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E83EA1EF1D; Mon, 25 Mar 2024 14:05:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="RHqU7EcY" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA30C144D31 for ; Mon, 25 Mar 2024 14:05:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711375517; cv=none; b=EKPt9ioHtGiggkDofFHVNJJLNjjbRHQdTyO11Opat5+IqT4fIF0s0iZam0zCS8PN3F5uLOKDy2+6NBSgxiiQROyJHvAf/6ZRSij0o4g6885U+jaHEnwwt69pvv/U93nG8yu/kxvlIgCRaunc5TdA9LbV37tcEHvhP27j+8/ZVe4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711375517; c=relaxed/simple; bh=T9mPTJFdFAlJ/5JVcluvxN9ZlyxsQJe7jTARp57+rAU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dWZ+kPxg2zf5yEXQhnrvKdL/dx3QUfslVIn0caWhVEH1dCjdo1/V0smo74J/wpivLAGNZSRUMllDh6OXkHv32C3ut3YI3HsBvABuWqntoUfPv2unX3pLiXBMvcDxNj4fpVZsMMujmxmGCk3AvPBgxz3pTvztxl2zP/8rPadAY44= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=RHqU7EcY; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=7licXzL4httiCp5hSTNrvtPUOGc2UkcCW0a7xMc5f/8=; t=1711375515; x=1712585115; b=RHqU7EcYCQwo+4Ao/+phVG6459GQ77a5qB/1ceO2PsST0cB5k+qcvMzJ60TQ3e4xpadr8dUk9+T MyaQeHa9Hpa6Lsvhm/0GT/MwGrVSMqguAdArs9ntss0M2KMgqb0I09JM4EUHsZ1YvwqFCzCxfH+sL 1Cvw+eu0VQqR+VuTK8wUaq9gxK/9DV6LwUr6ofEdASiNGDk4b9vhq27wt90W+RxhJ5T9oOZ3c0TUS ZmZFGWHQu6i4cfM/CYIfrGBB3Mbo7GCcAvI6AZfUlbxUKoKN3WWJ9nCq4VaEk7oj9r3L9QaygFZr2 i5IOY6j5tDxCeTV5uXTvPUWLIaLaU4jCPyHA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rokwp-0000000DrbV-0nzB; Mon, 25 Mar 2024 15:05:11 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg , Miriam Rachel Korenblit Subject: [PATCH] wifi: mac80211: use kvcalloc() for codel vars Date: Mon, 25 Mar 2024 15:05:03 +0100 Message-ID: <20240325150509.9195643699e4.I1b94b17abc809491080d6312f31ce6b5decdd446@changeid> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg This is a big array, but it's only used by software and need not be contiguous in memory. Use kvcalloc() since it's so big (order 5 allocation). Reviewed-by: Miriam Rachel Korenblit Signed-off-by: Johannes Berg --- net/mac80211/tx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 6bf223e6cd1a..ac5ae7c05e36 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1604,8 +1604,8 @@ int ieee80211_txq_setup_flows(struct ieee80211_local *local) local->cparams.target = MS2TIME(20); local->cparams.ecn = true; - local->cvars = kcalloc(fq->flows_cnt, sizeof(local->cvars[0]), - GFP_KERNEL); + local->cvars = kvcalloc(fq->flows_cnt, sizeof(local->cvars[0]), + GFP_KERNEL); if (!local->cvars) { spin_lock_bh(&fq->lock); fq_reset(fq, fq_skb_free_func); @@ -1625,7 +1625,7 @@ void ieee80211_txq_teardown_flows(struct ieee80211_local *local) { struct fq *fq = &local->fq; - kfree(local->cvars); + kvfree(local->cvars); local->cvars = NULL; spin_lock_bh(&fq->lock); -- 2.44.0