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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D341EC5475B for ; Thu, 7 Mar 2024 03:01:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 446E26B00E7; Wed, 6 Mar 2024 22:01:31 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F74F6B00ED; Wed, 6 Mar 2024 22:01:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2BF396B00EE; Wed, 6 Mar 2024 22:01:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 19E356B00E7 for ; Wed, 6 Mar 2024 22:01:31 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id CC2B280FE4 for ; Thu, 7 Mar 2024 03:01:30 +0000 (UTC) X-FDA: 81868742340.29.9CE2DD8 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by imf23.hostedemail.com (Postfix) with ESMTP id 37A1314000A for ; Thu, 7 Mar 2024 03:01:27 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=mUEX82da; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf23.hostedemail.com: domain of rulin.huang@intel.com designates 198.175.65.19 as permitted sender) smtp.mailfrom=rulin.huang@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709780489; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=F+ZEWxJ7jatOx9SRp585qay1xVnXuPWlmiLARpnHrs0=; b=jFBg4xecMXmNpEUBOuMksup+Gij9DlOf6hfAbUs4aPd4eWqKJezE+G5fhljeZUMbCkepqC NWwM35B1jD08XYDcm3Hk70ZSS/agGBHi1Wp+o0T8jjyshvxH6YVyZMkr7pIEZriEAigMtO TePVHBfe8sstCG2f+c8pdZCgVTlWKfU= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=mUEX82da; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf23.hostedemail.com: domain of rulin.huang@intel.com designates 198.175.65.19 as permitted sender) smtp.mailfrom=rulin.huang@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709780489; a=rsa-sha256; cv=none; b=OdNLMM5PnifnSlm8PJ9W4ZGd50HwuPaxPZRbCYYQ3TXccpylMaCjhj7jqBaPXvg5Itz9cq wMY3qepvn6mygV7Ljz8Oiq7IXZf91nr0Go6V3dxwNT3miPVgAyalMZvme9EMJbP1XaEDN2 HpBUfknio/ikD7p8JqOWcsFpIrLD5MU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709780488; x=1741316488; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=jiLpUS83X9bqo/l0qgvT+USU1pSdPuVxOBLFS+X6ePA=; b=mUEX82daXpvxPo5KRDZzFb2zLUolpeIoFElKug6R0WY2RFOXlvjUyspN arG3+7dAXR5n7b29mcwmpAtsNcdefU9Ji5w/QgdWFJyDlyBZ/OscoNsT9 B8r8QUibm5fnqg7EruL63PywR1J2aznmFGRUWXMoDE5YLzXRedfQV6pgb RjqlBcva5tu1ugigfkjSQY6rxuFV0T3CE7Hjm+4Xs69V8hc4I6wU0As1q tWS37XbWBGnNUad+PZ5EizhX00by3kIeW8q81rd4GLHK4IM9WtCTH/0lY exFZuYwtJJ4emfqSRw4RYeC5HUgn1S4pqnUKcQWmf/SQ/AnYpNB0hcdfX A==; X-IronPort-AV: E=McAfee;i="6600,9927,11005"; a="4289146" X-IronPort-AV: E=Sophos;i="6.06,209,1705392000"; d="scan'208";a="4289146" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2024 19:01:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,209,1705392000"; d="scan'208";a="14457352" Received: from rulin.ccr.corp.intel.com (HELO [10.238.4.104]) ([10.238.4.104]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2024 19:01:13 -0800 Message-ID: <140860ab-59f2-4633-8a55-fb6cfa854250@intel.com> Date: Thu, 7 Mar 2024 11:01:11 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 1/2] mm/vmalloc: Moved macros with no functional change happened Content-Language: en-US To: Baoquan He , Uladzislau Rezki Cc: akpm@linux-foundation.org, colin.king@intel.com, hch@infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, lstoakes@gmail.com, tianyou.li@intel.com, tim.c.chen@intel.com, wangyang.guo@intel.com, zhiguo.zhou@intel.com References: <20240301155417.1852290-1-rulin.huang@intel.com> <20240301155417.1852290-2-rulin.huang@intel.com> From: "Huang, Rulin" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Stat-Signature: rkbujuucgguh5p8g64tg44xy83m9fd7k X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 37A1314000A X-HE-Tag: 1709780487-712859 X-HE-Meta: U2FsdGVkX195yv0cpWBUr3Y1FL9HGE/wSayc9C1DxODLMIeA+toWjNzhJ1SQIRa8pOACfdF9EUW6I8dU4fomWf16+4xDXUS4eIDYN2xUqz6FdTnEW8dFxOY1vBZm7T8fJiC4dFUdEZ8J2MXUeJUzaXnwk6oYeUW3JiBZFE0F4tgaXcpPz8Eca5QlgtxNCr8vjXEN/kt7HNUSmynopCkVZCevCh5kIvzhpzGmXmq9p8ikpKmIFdTAJlJIF7E1fPaQHRNMQLWQBhpWI4sHBW/HtRKxBUgZ95YMEip11wmEVqVq7VJEDRBrws8ANxq3sH9EoIw/FM/zOEsNfUiIW4L0p+5FYWbYMNQlqYFZtwmPg6gz29kysowAxLPF8MhNIJBqGoU+OIFvDqCgL93acreSb6KR5B8Y+Qz9EW6/46M89YhMTNgXcsIi2nnNSnqzTSbBZi9eY3mDRtVuBxTEtiA+KaKza1mFi0BlQjmXTWnlQb+YKfotrKb5/exoZ4gHDSTtohCUjSsTwaK/5sLk3lfO7XuiH+vygLbMbDG+a5cFaIVN94Wrw4B2UY+WCSf38qKM9beBOpMC1CFrwxH64jw4ZiKsP3CzpSl+dbD/KYaiXwWbXhiIgwTdrGBbuBmtDC2J8WskiUdAhEsVu5SvlMHh4Y4eXKmgROA4oEBIbbwsi3FFvlKp7FGKV4LR/rGpWW4YyLJlkcGC9FfzVUCWfuT+lvMXTUdSfR/9BA57QtmYp6efESh81wZPyJ5F7+8DLFgq4humpP/ElHG7kIy89wJWskPDd4DNxQ2VvMLRrQU7K0iBtyAa0eFJizUMVGIueJWY4JdAZrQWuWaMESQyP5x2RpH0BL+8GaWMzmj94FI3q/TBhemBFHbnbSPo90piuYBO X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: We have made changes based on your latest suggestions. 1.Removed bugs_on. 2.Removed adjustion of macros. We submitted patch v8 based on this. Thanks to Baoquan for the discussion, and could you please help to review and confirm if there are any problems on the latest version? On 2024/3/7 9:23, Baoquan He wrote: > On 03/06/24 at 08:01pm, Uladzislau Rezki wrote: >> On Fri, Mar 01, 2024 at 10:54:16AM -0500, rulinhuang wrote: > ...... >> >> Sorry for the late answer, i also just noticed this email. It was not in >> my inbox... >> >> OK, now you move part of the per-cpu allocator on the top and leave >> another part down making it split. This is just for the: >> >> BUG_ON(va_flags & VMAP_RAM); >> >> VMAP_RAM macro. Do we really need this BUG_ON()? > > Sorry, I suggested that when reviewing v5: > https://lore.kernel.org/all/ZdiltpK5fUvwVWtD@MiWiFi-R3L-srv/T/#u > > About part of per-cpu kva allocator moving and the split making, I would > argue that we will have vmap_nodes defintion and basic helper functions > like addr_to_node_id() etc at top, and leave other part like > size_to_va_pool(), node_pool_add_va() etc down. These are similar. > > While about whether we should add 'BUG_ON(va_flags & VMAP_RAM);', I am > not sure about it. When I suggested that, I am also hesitant. From the > current code, alloc_vmap_area() is called in below three functions, only > __get_vm_area_node() will pass the non-NULL vm. > new_vmap_block() -| > vm_map_ram() ----> alloc_vmap_area() > __get_vm_area_node() -| > > It could be wrongly passed in the future? Only checking if vm is > non-NULL makes me feel a little unsafe. While I am fine if removing the > BUG_ON, because there's no worry in the current code. We can wait and > see in the future. > > if (vm) { > BUG_ON(va_flags & VMAP_RAM); > setup_vmalloc_vm(vm, va, flags, caller); > } > > Thanks > Baoquan >