Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp305117lqi; Wed, 6 Mar 2024 19:01:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWVNa7cj7r72ERrBHLamomnnBwDZ151gOGtBKiYBBKln8cMFJOeEioeeptvxnTYH2mAr+uhvNY6Iq9qEVAyid+d0aUMdVlgG/IR0dfdYA== X-Google-Smtp-Source: AGHT+IEd1WzjyS+qbHd90gV2sU7avMN7DCXeU4rTsqU1bnQbhwxMNPnPy75F+E7bfgGAgbBPsJ0J X-Received: by 2002:a17:906:5ce:b0:a45:c694:98ae with SMTP id t14-20020a17090605ce00b00a45c69498aemr1283652ejt.20.1709780496988; Wed, 06 Mar 2024 19:01:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709780496; cv=pass; d=google.com; s=arc-20160816; b=BaCOLmIJmJRiqRBC9oa+rnA+WNLHcELfWIenbjpV0925yAwpOXK0k+cgNRKbMNjR/1 7rL/+Rqm2NaADqRXiV1ye19BIWI28eU/O8J31aQdD6giLboJsHaW/ovXbgswBsSoFQKi l4uHwugIoi1fJjroLms9R7Bx9apASpb6IyVjF+ToDbTW+OC90mgIukaGdU4fIlz6M7r9 soHaB2rezYk9pNvurUQ1U28OBKLMJlj6zy7qHblITb30jPs+ZMjUFbd7ec6l2Mkbo2gt E0D8bLvpAIC84cnihH/NBa2Dq4mMKVMke91Cv5ptWPELpHPffkYuyglzOSoSFZhg92Z4 kjQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=F+ZEWxJ7jatOx9SRp585qay1xVnXuPWlmiLARpnHrs0=; fh=2HDrIgSp09q/BrSrYHu95tTld9HcYwwmHGXsogLAEFM=; b=ocaTWxNjOX0WeJR3zQHMcRDxaRCB7ZVnTAZZpH5B5qU1YJ+TI6S4xmjGUC2qTbQwnX dFcsWptnDBMrAKtB0KC0gndactApZOu5iO1PLts8WbUO62D91MxoDEywufTIUQBx4cz6 99joiT2zc4SjCTc2K9yMq0tWt2Pwh8yAo2Zs37IVJUwNcBwAEgaZVlAD+1Rkoa2pIr5R obnZixxSxQEtH/Spr0RWWSjyxO3Yv1WCCi7UOL7/b64BVV0fR+b3WLnzGJ1G8lzikBZd tzjWiZwMHugJJejO/+JCBcPAGjqZiJCUCABTHdQN+guW6Px2toUy+7KhNmCdccMyxLBV RVJg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fCDOyvXl; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-94899-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94899-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c13-20020a170906528d00b00a3e3965250dsi6459450ejm.883.2024.03.06.19.01.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 19:01:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94899-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; dkim=pass header.i=@intel.com header.s=Intel header.b=fCDOyvXl; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-94899-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94899-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 B65D71F243BA for ; Thu, 7 Mar 2024 03:01:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13B2FCA6B; Thu, 7 Mar 2024 03:01:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fCDOyvXl" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 D534863D0 for ; Thu, 7 Mar 2024 03:01:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709780489; cv=none; b=plHsRnFz2fG4FQ31KDHYWB8Zj5NWnb865pkS83RudeU8w/62HiIqyrWOFptgw6mxvNOz1lKBe04yjSTt4dvTRU4VlUx3FnXeKxEszIVglh7EGJhFDVoWodX1YYg362M5ARF/Za+kxEF7L+pjpVVhPEt2nQJlsPUOH0GtxpazfEg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709780489; c=relaxed/simple; bh=jiLpUS83X9bqo/l0qgvT+USU1pSdPuVxOBLFS+X6ePA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qhk5wDz0qVhmDlI9/pOghLRRZEzeBfNBF4EvQnz1VoQR7cq1shRLERn+2jvnidAGiHu7twQRLsROm/gCFlafFbmoJuVBgWtkQlF8CnW9y244hLIJUlhgfQtbojmGdzB/ZBcNd3bcj4OEAOjtI8EJZyGyDnpdrMYro3mLlCuyCTQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=fCDOyvXl; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709780487; x=1741316487; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=jiLpUS83X9bqo/l0qgvT+USU1pSdPuVxOBLFS+X6ePA=; b=fCDOyvXlL/WGROeKSVZU+zfwvTjMPQj20a+QQxuRXE0mhSE8c/NKJcFA mzecJSERir0nLYNoSwnCvALgfxO2uVkzIm6o41s2p0w9aIpjWDSFYSMp0 81oVg6YOIdT7xI8EcwVIBIvddf7uABK3HHeN3iJkw82Zx0uJ8ClZCu8E3 Zv2gnXTMwTVCqtSGjl2tYjk/qnOUYin11VEAeePS/OxxR90CxtK7LMdpG QjoLCGfGWLbhWA5IL3Z7xfspxdnhf/DXnaPQfCbhT2Uq7j87/OX1FFN+L oQJKPdmtYYEE+sTL85QV6HJvWhO86U2rPE8GRYk7/MRznLmV2P/0lziRi A==; X-IronPort-AV: E=McAfee;i="6600,9927,11005"; a="4289142" X-IronPort-AV: E=Sophos;i="6.06,209,1705392000"; d="scan'208";a="4289142" 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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 >