Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp392860rwd; Wed, 17 May 2023 20:56:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4QYEHplc4MFhUMg5OGh0OlJqD7N18MQnkgtqPG2KbgLZwSVcQRjWxktsUAlr7pxSiIiC8G X-Received: by 2002:a05:6a00:2e15:b0:645:834c:f521 with SMTP id fc21-20020a056a002e1500b00645834cf521mr2173952pfb.17.1684382183584; Wed, 17 May 2023 20:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684382183; cv=none; d=google.com; s=arc-20160816; b=mYxVWZTIDEqxNjhTW9hKdl72yjkA0WhLa8WEScEIeRO5Y4ipa95YdcEZG5jml+lqqb pN4FbLLa3jPm6PiDw095FdhPzF6qSMpp6o7p8qusKSvpkhDivCOZQWXUOmxaMROpVk7x zU2neOcZxpSWdI5nwZUkk5DKG2eL5gy/RaM+7s2GqPXLUYdD5VKIAu6THrzPt1tyN/hV F99EJtsvVSuIeDqx/nqi50oghNsN4vObOjtN/dh6GiPqZP+QHxRw+6F7k+i3TqgWCT4q P4pNc9EIuAsrpqvKG7NAAraYTPpYquo3jV7hf3oH/wpTcQ08zEV6MldU1TNZQuhrtsPe pHZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=I3ysGB9JuC72T1aDtCFkPNC5a/f2mcf/75CpRKANTR0=; b=hFJDaoUweRp1UCR9BAhpRBiWu1BTQp/co/PK7SpYid5sAo5RZz7LyB/nZbwxKgGivo Rz38vHTiw0+2sEx1EgqBm0rwheaWf0d7GeXhOP3giyB5FwRUI9svP/uoHkQ307G2/vJN uKtjRv2N/GNJjB5Ew2rlZuZ+vVw9/f1l/vEU9uOlWhAfJTbHMbJxSLseyP7OCb4CAxaC 2CIRlTs54+qks60v7pap66d7mVFE3CdTHf+uTMuD2fNfOnqjhO/a7rfY3x1wKBmAkiOl gKA67MYEwwSArhdjbO+dNsIlZHJSSjkBQuBD8lQCZeFznOfNp3vojz8iTP7s+84PQ3yf fK3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=emt0vO2c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j76-20020a636e4f000000b00518f82d7053si450138pgc.493.2023.05.17.20.56.09; Wed, 17 May 2023 20:56:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=emt0vO2c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229582AbjERDn7 (ORCPT + 99 others); Wed, 17 May 2023 23:43:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229655AbjERDn6 (ORCPT ); Wed, 17 May 2023 23:43:58 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2656D30ED for ; Wed, 17 May 2023 20:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684381392; 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=I3ysGB9JuC72T1aDtCFkPNC5a/f2mcf/75CpRKANTR0=; b=emt0vO2cKPa3n90EPmbPMA95yE6wIE44OhhIoX36DAofhYQju3mPsu295kLMRc5pXkdbm6 elfpMb0ELFMVBVJT7RR6ajDvysYlCmoW1ntRwyVzjWMoYuwQxglHU54sN7MgOIP/lPC6GQ 6j2OCkGzgIcDWS6LR5ahO1SmU0D0/rg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-191-rQ2DqjWxP1SY7-nQyd_h8w-1; Wed, 17 May 2023 23:43:07 -0400 X-MC-Unique: rQ2DqjWxP1SY7-nQyd_h8w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 727DC88CC40; Thu, 18 May 2023 03:43:06 +0000 (UTC) Received: from localhost (ovpn-12-79.pek2.redhat.com [10.72.12.79]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B0F1C2166B31; Thu, 18 May 2023 03:43:05 +0000 (UTC) Date: Thu, 18 May 2023 11:43:02 +0800 From: Baoquan He To: Christoph Hellwig Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de, christophe.leroy@csgroup.eu, agordeev@linux.ibm.com, wangkefeng.wang@huawei.com, schnelle@linux.ibm.com, David.Laight@aculab.com, shorne@gmail.com, willy@infradead.org, deller@gmx.de Subject: Re: [PATCH v5 RESEND 06/17] mm/ioremap: add slab availability checking in ioremap_prot Message-ID: References: <20230515090848.833045-1-bhe@redhat.com> <20230515090848.833045-7-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/16/23 at 11:30pm, Christoph Hellwig wrote: > On Mon, May 15, 2023 at 05:08:37PM +0800, Baoquan He wrote: > > Several architectures has done checking if slab if available in > > ioremap_prot(). In fact it should be done in generic ioremap_prot() > > since on any architecutre, slab allocator must be available before > > get_vm_area_caller() and vunmap() are used. > > > > Add the checking into generic_ioremap_prot(). > > Should we add a WARN_ON/WARN_ON_ONCE to aid debugging? Sounds like a great idea, will add WARN_ON_ONCE as below. Thanks. if (WARN_ON_ONCE(!slab_is_available())) return NULL;