Received: by 10.213.65.68 with SMTP id h4csp2112095imn; Thu, 5 Apr 2018 09:09:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx48ok3b8ILkgsqFI/0Uwy2IlOV4jWwNQlN5/lSKfE2bKUmnzZxF+XP0eelEQOZ6+jNPXKuz8 X-Received: by 10.167.129.215 with SMTP id c23mr13177110pfn.17.1522944570789; Thu, 05 Apr 2018 09:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522944570; cv=none; d=google.com; s=arc-20160816; b=NXGiyHUMcBwexKRql7Nc4s0J7w6MXWND56K1GtjXlZ91UC7tTYsbvzLe5zH1KFK2yC R0Q9tL0irRBBJdUxJzXfO+qejxRUH8W9wuEAhpIwivEu3PV+XwifRn118ASxFLtPiVAo 1D+nNS8055sicf/0jD0IB7+VNRihqFc9GTxXk09WZhvtlAb6Av0j0vxnAblsmEHDdgt3 IY+XKYqwREYk/6etHqhwbwiZ+sMC6jzxASXUaJPOcfBiRk33uaqzB5+FMUQR9wZZgluU CTc7/kLRd8vzJDGSgG4SVBfXDHJrb+ckFd9o2CKecLLksg38s0g59Ic9m4lMba8lfVyk Z5Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=49i0aEgPox8T6wFHilPpSbNqLb/Ig0Wbtea126hfPFo=; b=F5tQXVCbR+mCkSWKfykeCCmQytnC7W4EhMKb7asmZINPgBE3a51jETYsUpAm0cfRd/ PA4fEVoWlvE/Sy/URbIlCSN38kI1CztP2nxWoDjegu3hF0DOMJh4CAMAZTkAy9mVgm4b mtLnOp6/vKwWC2WuaMn3mcOZuFUCHd2lCvCE4GcG8Q31L6eOirf9pxjOmNkA+Fod9O21 Pt5kEUtwwMVQnLiIl7vMgYhwfebW1ro+m/ZsGHFKCt5ZBJ3e7MR2gislK8ffL9EvcCvX uJSV8cGA4zU3siTLjfgjpR93vVtqdBS7nl8YiAMNxSbNZHT4jEMJktCpMoi8Cbu3E6vV fW+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=HEw2OBVy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b89-v6si8534438plb.262.2018.04.05.09.09.16; Thu, 05 Apr 2018 09:09:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=HEw2OBVy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751451AbeDEQIA (ORCPT + 99 others); Thu, 5 Apr 2018 12:08:00 -0400 Received: from mail-sn1nam01on0056.outbound.protection.outlook.com ([104.47.32.56]:23584 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751277AbeDEQH5 (ORCPT ); Thu, 5 Apr 2018 12:07:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=49i0aEgPox8T6wFHilPpSbNqLb/Ig0Wbtea126hfPFo=; b=HEw2OBVyUUdNtb5lUhitVMZVmdmrsPstETOXjmMJiQv/CoW7UVrdRc7lb1FjH0otR4tOHq7u8ozh1gPghBQmKV+ZZgyqOZAOQHO6iBKpgmFNrn4xmkdyX+0Fwc9mC5EbDCBl0vl6U+fkdAWHaYUW0+lMAeFem9o5eyGAwEjRjeU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Vadim.Lomovtsev@cavium.com; Received: from localhost.localdomain (50.233.148.156) by DM5PR07MB3004.namprd07.prod.outlook.com (2603:10b6:3:e3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Thu, 5 Apr 2018 16:07:53 +0000 Date: Thu, 5 Apr 2018 09:07:49 -0700 From: Vadim Lomovtsev To: Christoph Hellwig Cc: sgoutham@cavium.com, sunil.kovvuri@gmail.com, rric@kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net, dnelson@redhat.com, gustavo@embeddedor.com, Vadim Lomovtsev Subject: Re: [PATCH] net: thunderx: rework mac addresses list to u64 array Message-ID: <20180405160749.GB12703@localhost.localdomain> References: <20180405145756.12633-1-Vadim.Lomovtsev@caviumnetworks.com> <20180405150748.GA5716@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180405150748.GA5716@infradead.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: BN6PR16CA0016.namprd16.prod.outlook.com (2603:10b6:404:f5::26) To DM5PR07MB3004.namprd07.prod.outlook.com (2603:10b6:3:e3::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a08c635-51f9-4baa-0708-08d59b0f6412 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:DM5PR07MB3004; X-Microsoft-Exchange-Diagnost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9KG0ikDbmIIFxf9pra3/1ahGEuZ31H8hcpWzKcliSGaXIxDppWE3xNNrSMRfjirexEum+rdKJwsRZyfq1aINQcDg/5mTWJFl4v+gY4fcqhVyvsl3dVn7Uz2EpTHoCIZRb/ydHaSYMOB+hUJyU0UFOxwswj/CLygqcwHvMFJ2bQvVw/OJzEM8Ugybh6guNtTfl57l2os08CK69LcvK6P2KVTd+Ytt2re5wab9hhZ4Fg0p+/8D9yWkMztGWXyKr/3eR1bkPtgcQ59TV7rz5xApRFxwyWnNBp4snV4cRU7QQAy2bkwlztdtwDu79NeJkggxvFz0Xj6cHJv6yoBgeZmtU4wlv1c6NjgCmTwbPa8kfoAy9qkMoo0eybwxrm24gCeCfIKjtP3DLb6dNnYcN/FcsVR5eM7XSnGHrEuOejrzF4z0XVLl/Zp+a3wpNCea72m5Kpd3TJLDcFOEXaOzJy2ElWzFGj/6+csE=;4:aqtxVgBiOxJJ8n2jHTyMVB09TuNRUO2DJKGKQdBK3K/a2mZDLqjbuEn5DpCRYIOm2r+E6p2Ebjp8VpNQiEMHG1kIFsj53AISPc6t9zoSKE2dXcnbr7GsEEBs5hdcuN5/9cbJuCCbgWHVCYxCNDN1zz5Ih6SR1luKpC1M2keDVgqPmpFLfUzIGhQQrW36M/BhjPgubKFFHGPhAnc5Zcn7yXcknHJnQPfnWKmZIalpRKXnkeQFGNZZwmU9M5HyTdx/OhkmVjWI0mAVmYEHWUOEEvWAXdcgvb57YRioq3jU5BVF54HPOeHEz+lJyPdnlwGW X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(131327999870524); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(3231221)(944501327)(52105095)(10201501046)(3002001)(6041310)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011);SRVR:DM5PR07MB3004;BCL:0;PCL:0;RULEID:;SRVR:DM5PR07MB3004; X-Forefront-PRVS: 06339BAE63 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(346002)(366004)(376002)(39860400002)(396003)(39380400002)(189003)(199004)(6666003)(39060400002)(61506002)(47776003)(50466002)(6916009)(316002)(6506007)(53936002)(4326008)(9686003)(229853002)(42882007)(386003)(186003)(52116002)(81166006)(486006)(59450400001)(16586007)(33896004)(478600001)(55016002)(16526019)(68736007)(76176011)(8936002)(6246003)(66066001)(7696005)(8676002)(106356001)(25786009)(107886003)(23726003)(26005)(72206003)(81156014)(33656002)(5660300001)(305945005)(11346002)(1076002)(97736004)(446003)(2906002)(6116002)(58126008)(345774005)(105586002)(7736002)(476003)(3846002)(956004)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR07MB3004;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM5PR07MB3004;23:ObYLouoNAELousZsYa7aem1Ok6Lt0eAdjNyga3bmz?= =?us-ascii?Q?qBfzKobG98C8H1UAzzJPi0w/pll2wRxAvwsoWgLbJwaWkGUdxE5jHVJvubeX?= =?us-ascii?Q?mxGJyyip0rcU7gePNlC8Z2HmPytyM/k7PejIUddbp8/kxmPOc98nCpoiO+zv?= =?us-ascii?Q?kY1EC3o+MLBW6DSZ+cAIosKAysUhLru1q15X7vc0UAy6sM7pI/MizHOiBk4/?= =?us-ascii?Q?9q/nY5TDKOKDrnE6KspUWPkPQfqCdmBAdbdEO3ACm/kN7+6H9NTrwhSSfC3n?= =?us-ascii?Q?+tNfJBobtAuwcxDlpqehRpN3nHghZdZqo+4htcCKrvQLh7ZjNSElqrNRH5PB?= =?us-ascii?Q?tQkdDYGXRpyy5TDhovGgdOI/0pErLvoUpChaptadK26IUMBonJqQ1aWWe3tH?= =?us-ascii?Q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znaFdZ0wE=;24:jzivD/0iuD/I7q7+tLgMIUQz+P3BU6ask6KIrSStI7/2+GzTFf4TxrwCy69NYV3YQqouV8lb3H6o0HgdPX25FBYoxn1u6EUShD3vajFT9Ls= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR07MB3004;7:EUI5zQOtn8JLYw5e5jOu1wdU7Jqnt67J7paD2WhJxqjjZGpb78k8y8R54nSq0ZeuH51pDBGHikniIEsrV9s6qao0edGrrdqth9LsOZBjjukKlukM5vrYv96Gb0EjrLudWQwoxV2SJyfhsBicpXvBVGtJBvGjRYucqTeeFDtyVvKKLYVQEJpOzjEmaAMDs341yAL0hjYYhohRovefWQVJOZJQmwa5pPwt7tGUNA7t59jSZX65DeqxG9EFKpD6P/Ns X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2018 16:07:53.3979 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a08c635-51f9-4baa-0708-08d59b0f6412 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3004 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christoph, Thank you for your feedback and time. On Thu, Apr 05, 2018 at 08:07:48AM -0700, Christoph Hellwig wrote: > > struct xcast_addr_list { > > - struct list_head list; > > int count; > > + u64 mc[0]; > > Please use the standard C99 syntax here: > > u64 mc[]; Ok, will update. > > > + mc_list = kmalloc(sizeof(*mc_list) + > > + sizeof(u64) * netdev_mc_count(netdev), > > + GFP_ATOMIC); > > kmalloc_array(), please. In this case it would require two memory allocation calls to kmalloc() for xcast_addr_list struct and to kmalloc_array() for 'mc' addresses, becasue of different data types and so two null-ptr checks .. this is what I'd like get rid off. My idea of this was to keep number of array elements and themselves within the same memory block/page to reduce number of memory allocation requests, number of allocated pages/blocks and avoid possible memory fragmentation (however, I believe the latter is already handled at the mm layer). WBR, Vadim