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 8359FC54E58 for ; Mon, 25 Mar 2024 13:25:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B84106B0082; Mon, 25 Mar 2024 09:25:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B341C6B0083; Mon, 25 Mar 2024 09:25:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FB966B0085; Mon, 25 Mar 2024 09:25:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 8A75C6B0082 for ; Mon, 25 Mar 2024 09:25:49 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 3F66CA01D2 for ; Mon, 25 Mar 2024 13:25:49 +0000 (UTC) X-FDA: 81935634018.28.249C928 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf10.hostedemail.com (Postfix) with ESMTP id 6641FC0019 for ; Mon, 25 Mar 2024 13:25:47 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KxRCf5ZX; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf10.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.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=1711373147; 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=3rsTyywAg29LCuVZyTkBA2UQHPKiAemlnTeHvMeLWIY=; b=r5Sk6Oy/868/AwU39REFuvm6zy8m5AmPJpK6Mo1cwNM/6RnZKU6QnS5U99cxJe/fmCghHb +eZd1HttOAf4zNMuK0+XHK/SoFdkmgv7JT3BZ7Cw6Oprt6JfJHM0iK80q5Wm7eZT/ciwX5 AKTTCeIBDq7GPKGlIeZtOZ39ejEusjM= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=KxRCf5ZX; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf10.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711373147; a=rsa-sha256; cv=none; b=PziYwJPJg+LZLeFNueBCN2DDWirZyDP7vY4WLQbbxjxAzbra1XnNKc+RkQoJMEKGrTIKh5 tnMeLhrhn1ZwAR+a1aE03ZvHtfl37Svm4EGIYhCFpsCC6GG4tlVjfFtHqzQxhW9prw/yAz JWVDRleHbMAnk8LM9J3CMoUL/40rHVU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711373146; 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=3rsTyywAg29LCuVZyTkBA2UQHPKiAemlnTeHvMeLWIY=; b=KxRCf5ZXHYWMRxhiECp5gkENDw2ewHigLXkeSYj9TqYLjIuL7rKagfKzSaZTwz77vY2DKo uTpfw3Yo/I00M5sesElPdqBfaJzJQqrd2IlTP9rj8ipzd+BiSuVZ62R9QP6rR/zno5CZPX jdrjIhQ9UW/fT1yDM1spHEpSuDv1VCQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-2-rHvBGZYgM6qH6BXl-2fBvA-1; Mon, 25 Mar 2024 09:25:40 -0400 X-MC-Unique: rHvBGZYgM6qH6BXl-2fBvA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 35251185A786; Mon, 25 Mar 2024 13:25:38 +0000 (UTC) Received: from localhost (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F091492BC7; Mon, 25 Mar 2024 13:25:37 +0000 (UTC) Date: Mon, 25 Mar 2024 21:25:29 +0800 From: Baoquan He To: Heiko Carstens Cc: Christoph Hellwig , "Uladzislau Rezki (Sony)" , linux-mm@kvack.org, Andrew Morton , LKML , Lorenzo Stoakes , Matthew Wilcox , Dave Chinner , Guenter Roeck , Oleksiy Avramchenko , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , linux-s390@vger.kernel.org Subject: Re: [PATCH 1/1] mm: vmalloc: Bail out early in find_vmap_area() if vmap is not init Message-ID: References: <20240323141544.4150-1-urezki@gmail.com> <20240325093959.9453-B-hca@linux.ibm.com> <20240325111650.16056-A-hca@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240325111650.16056-A-hca@linux.ibm.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Rspamd-Queue-Id: 6641FC0019 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: iz998ixjs4c4wsfyswosxwiw7y59bge8 X-HE-Tag: 1711373147-677607 X-HE-Meta: U2FsdGVkX1/esbXGGnnhK9GYAhQeyP9hgP6xiVFkpnzmd3Mi2s6YeNj6uip50ocRlrshIWsXOAaaZj7suozhtNwJnLsA1YttyjQuZJXqQcFTP/G7G7RGxsCfQtSF+vLlJb2YAnuAhnWRTFVWHogAmzAvooVuCL6/R9xHgUE/UpG55THQV5HjwxQDChCEjRKI3SxxGBxZOJCE22S7yogLpjLTVDqGZujbiZFLvIhAXdvDNrsOdSMYqSU7HE4peAYe8iyUP8AuCbrXr1huSlNKxBx9EFWKI/1vCdogCV8N4ycuN4WQVTLsmmxefjafISqKo7PMOZE9zh7Y2KRYyYQQtXsAipHEGnrqI0m8dqaNzNOob1O6LlUN0sjzPR1Bo7CZGm6yYi2DjHVS+MhN1x8ROPJEd7tVuq/1xwQKhOSUTEE89c6PMC2oCyLLWtduVVE76VLBdVmxW6zhLRGesN9yQBLH/mnPIvamntya/HrHlwIVqp3SKODnNmfw/uP4nWy1CkPmNnJDiex6/OhfyBK9rxmRwmGFa/ZCnXQw3KXujQyHHXnbry3jBg39JMt0zHdWVXuL8WQr722NrbUdkerb4BerOgrxkYJO54yQ8P0j30zfkWYC5EQbPLi3CyicjQwYztQ1n93Hoxnpp79yM6nlUb303q2gsoFyxptLSoJn2gSnKtbvzWLILZTizQlOmErVlWO9z2hgeHE3KV5xT7UpTVT1/qzpuxCF9+rMjtYT408J9mymu4OyfIHxl8IDC8hNRHxb+cTGxRcVllICATnKV+KtyA02krgDKJqZUzVjMOFgBNQkc8xRsi/c3aIJZlbCeNg1lHZ7kTKNBaEagibszX02TRnCEhpvYGXNP7KD9xlYmMEeooFK0eB83FHKuiUwg0yfMjhRoIYBnN3pxsKsr897M+UxI6t70OUfys97K5yFzY0noirJuEHpNrfaPx4J 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/25/24 at 12:16pm, Heiko Carstens wrote: > On Mon, Mar 25, 2024 at 06:09:26PM +0800, Baoquan He wrote: > > On 03/25/24 at 10:39am, Heiko Carstens wrote: > > > On Sun, Mar 24, 2024 at 04:32:00PM -0700, Christoph Hellwig wrote: > > > > On Sat, Mar 23, 2024 at 03:15:44PM +0100, Uladzislau Rezki (Sony) wrote: > > ......snip > > > > I guess this is ok as an urgend bandaid to get s390 booting again, > > > > but calling find_vmap_area before the vmap area is initialized > > > > seems an actual issue in the s390 mm init code. > > > > > > > > Adding the s390 maintainers to see if they have and idea how this could > > > > get fixed in a better way. > > > > > > I'm going to push the patch below to the s390 git tree later. This is not a > > > piece of art, but I wanted to avoid to externalize vmalloc's vmap_initialized, > > > or come up with some s390 specific change_page_attr_alias_early() variant where > > > sooner or later nobody remembers what "early" means. > > > > > > So this seems to be "good enough". > ... > > > Add a slab_is_available() check to change_page_attr_alias() in order to > > > avoid early calls into vmalloc code. slab_is_available() is not exactly > > > what is needed, but there is currently no other way to tell if the vmalloc > > > code is initialized or not, and there is no reason to expose > > > e.g. vmap_initialized from vmalloc to achieve the same. > > > > If so, I would rather add a vmalloc_is_available() to achieve the same. > > The added code and the code comment definitely will confuse people and > > make people to dig why. > > So after having given this a bit more thought I think Uladzislau's patch is > probably the best way to address this. > > It seems to be better that the vmalloc code would just do the right thing, > regardless how early it is called, instead of adding yet another > subsystem_xyz_is_available() call. > > Alternatively this could be addressed in s390 code with some sort of > "early" calls, but as already stated, sooner or later nobody would remember > what "early" means, and even if that would be remembered: would that > restriction still be valid? I agree, it's better to let vmalloc code do the thing right whether it's early ot not with Uladzislau's patch.