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 6DCAAC5475B for ; Thu, 7 Mar 2024 01:23:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E060B6B00C9; Wed, 6 Mar 2024 20:23:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DB6366B00CA; Wed, 6 Mar 2024 20:23:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C7DDD6B00CB; Wed, 6 Mar 2024 20:23:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id B55296B00C9 for ; Wed, 6 Mar 2024 20:23:21 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 804BF140FCF for ; Thu, 7 Mar 2024 01:23:21 +0000 (UTC) X-FDA: 81868495002.04.206041E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf25.hostedemail.com (Postfix) with ESMTP id AD81AA0006 for ; Thu, 7 Mar 2024 01:23:19 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=BVAP0iaS; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf25.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709774599; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=94mdsQQK95yEtTcufvNh7AUE/lCdC45A/gjJVlEP7/0=; b=uFrxaI9w82hR994PSNP0p7zP4MTQBla4l2/7ILIV2WQ6w8zLH9vWV1lRt3TSatLUsV5VJ0 k73WRm2A4OVLk9bK5pCirThf3K03dqCybEHkHxWyj0GL8t4VI6EWBOGlBTkpD1ESzTDrEg 92UpI28up9mYefFfyCnNU/50CFmQGV4= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=BVAP0iaS; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf25.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709774599; a=rsa-sha256; cv=none; b=FkhxVZQvWzMzLGLihbVfY7X7hQ7O+I9HdxYHgZmeMbfzTS5CyMtTeaF24yjoUEHNT+w9s2 JwpGlLI9oqdZeN8FoJEbnrb4BGA1gccOIQ6mjuApP5uLGW4wpkaPHsdrFKrssFNBCN9gbs woOxZ5zkEvUDXNkTMnbBSqXLNmuhSYw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709774599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=94mdsQQK95yEtTcufvNh7AUE/lCdC45A/gjJVlEP7/0=; b=BVAP0iaSC6vKKcxb+yGOVEpjEglhOAitS8uapwkG0put/LT1wi2ZcJWYD/qOxWBVbEiSmy ELU2pMJLtqSp9I0gSHuQ8rULn2l6ybG6kThpIv3oJ7lwgFQlLzkqrGugffO70BKo6ISjur 3mZl7aMGU/ABuMlgG7sb5iDgJNBeFOU= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-17-QXrM6ykqP5CSfzd3uoJ3Xg-1; Wed, 06 Mar 2024 20:23:15 -0500 X-MC-Unique: QXrM6ykqP5CSfzd3uoJ3Xg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C28C73C0EAA1; Thu, 7 Mar 2024 01:23:14 +0000 (UTC) Received: from localhost (unknown [10.72.116.15]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E3D3A40C6CB5; Thu, 7 Mar 2024 01:23:13 +0000 (UTC) Date: Thu, 7 Mar 2024 09:23:10 +0800 From: Baoquan He To: Uladzislau Rezki Cc: rulinhuang , 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 Subject: Re: [PATCH v7 1/2] mm/vmalloc: Moved macros with no functional change happened Message-ID: References: <20240301155417.1852290-1-rulin.huang@intel.com> <20240301155417.1852290-2-rulin.huang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Rspamd-Queue-Id: AD81AA0006 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: f9rkdtyhtg75kmr1t9s7n1cze58th667 X-HE-Tag: 1709774599-465308 X-HE-Meta: U2FsdGVkX19oCTotJuLpBWm9RBVXAnOV98fea+0ozzLRt1mQgSAvzGY70Evv6/6q+cfgfxrYDjeYbNe+4n9LgHYFUuRxz3JmhyZbriNreOD5uH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slaDm22S3EupLFUjObYsA11DLi1EBwCOfBDieJW066Mod/gTMwWu4WZIziB+ 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: 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