From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27740C433E0 for ; Tue, 23 Jun 2020 09:23:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EDB6C20781 for ; Tue, 23 Jun 2020 09:23:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="uwd8NM91" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731919AbgFWJXy (ORCPT ); Tue, 23 Jun 2020 05:23:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731912AbgFWJXx (ORCPT ); Tue, 23 Jun 2020 05:23:53 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 855BEC061573; Tue, 23 Jun 2020 02:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=n42uQFh17CdO0bIElKUPrWq2FZ0jIAeEhIRWnOCALuU=; b=uwd8NM91afP+YPwWO0zwWWECYF te8u/t4tum1nk/XdFbYYU/ZyLOoDRuEj5aRqUrDQO45/erMoawOMwOjZAioaX51dTXjKamd2vtar1 BwImxnHqwdzY/Cn3tSKyaPRaLu5qOZaN3raDA/JXMB1lWSvLA0CizlO5iAw2HggPqtixMeGbsWSkX 6dVuKdU+5Kd0bD+d11ZrppzcItzKCL1RDNMJfI3WYakzbXsT8gdXTqqrx/oszZNsZ4I38EvycrLEo IPLCOGE+0zxP6ZtLeSfgmZOK34uAzkwKfNT0mm8KxVPXQ03JH0+q0C3Br72eNHgo5bbEyQA9fvogA FakPkASw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnf98-0000ln-Hf; Tue, 23 Jun 2020 09:23:14 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id CDE0F3003E5; Tue, 23 Jun 2020 11:23:12 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 65933237095E6; Tue, 23 Jun 2020 11:23:12 +0200 (CEST) Date: Tue, 23 Jun 2020 11:23:12 +0200 From: Peter Zijlstra To: Nitesh Narayan Lal Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, frederic@kernel.org, mtosatti@redhat.com, juri.lelli@redhat.com, abelits@marvell.com, bhelgaas@google.com, linux-pci@vger.kernel.org, rostedt@goodmis.org, mingo@kernel.org, tglx@linutronix.de, davem@davemloft.net, akpm@linux-foundation.org, sfr@canb.auug.org.au, stephen@networkplumber.org, rppt@linux.vnet.ibm.com Subject: Re: [Patch v2 3/3] net: Restrict receive packets queuing to housekeeping CPUs Message-ID: <20200623092312.GC4781@hirez.programming.kicks-ass.net> References: <20200622234510.240834-1-nitesh@redhat.com> <20200622234510.240834-4-nitesh@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200622234510.240834-4-nitesh@redhat.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Mon, Jun 22, 2020 at 07:45:10PM -0400, Nitesh Narayan Lal wrote: > @@ -756,6 +757,13 @@ static ssize_t store_rps_map(struct netdev_rx_queue *queue, > return err; > } > > + hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ; > + cpumask_and(mask, mask, housekeeping_cpumask(hk_flags)); > + if (cpumask_weight(mask) == 0) { We have cpumask_empty() for that, which is a much more efficient way of testing the same. > + free_cpumask_var(mask); > + return -EINVAL; > + } > + > map = kzalloc(max_t(unsigned int, > RPS_MAP_SIZE(cpumask_weight(mask)), L1_CACHE_BYTES), > GFP_KERNEL); > -- > 2.18.4 >