Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1733023rwd; Wed, 17 May 2023 00:03:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4KeLTLo6XKZfhc9lAfjmvw/q9/YoAgeoWWqJ8KLvxrPFtomx5SEPw/bHkNqLOT+LqnmDyZ X-Received: by 2002:a17:90b:4a8c:b0:252:b14a:55c2 with SMTP id lp12-20020a17090b4a8c00b00252b14a55c2mr17397262pjb.9.1684306997103; Wed, 17 May 2023 00:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684306997; cv=none; d=google.com; s=arc-20160816; b=kwJ4JafIdNmhvhMVrFQ3uHJJHGv7MOdituPDc7TrwbQkfGJeZgldj7odaH2aEddKcg LvPgifbZFvxq92rHeuHlyYBj4Tg9l2+Z8l5QllW/bq8y2B2O+RXWKiUPhcxYBsbeMBgR HczbIU7hT5hwRlFgvWUYwIWv+e/yQ9jsJZAJj92NxIkWDnXkmc5Mktk5P7vFKrhj2NVI h+gGT9OZriRtlIrFG9mqEbKniwmmaejj4TaR/WKwYdnLF49Hm8J1PbfAZg61miA+rnAB Bx6yvumVqbPAmJ+bN/mrvjgZkIwKz+IqFmPEZvqBnTfEaNQ2n8zMvKtMYlDD/w2H7MHe EBCQ== 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=CykYlbUyBmsKpsUHUyxIc0LEz/CT+ai84PogzOUldYA=; b=DpoGZZKJ/NMSfxFVZvNm/zh2BCqfzVlk1vs2zUmQ5CoYhR3eXU98IuATzMYNf7yRef WWUW3k3SNpgZNwGvu++wVRO+fy6SAeeiMnFfsLyw2trJSMdFeht6eS3qO3jjgD19gwfV qBNjAUxoIyDR7NrFJgAB8sJV71bvvlezpcdWeiTCpm4oS8btHnXCQlYP/Z89aTzsxhZM XCdKnXIgygjSQTT4CoSs0lh+XmdMECMxZfwrtD/RmLXn91kRQYzIF/CprDKO5zFAjstx BFFd0BZK3vbcfhQdmbBMCptRcRKNrVkIDMmusQVl9O2lQOfBLF2fnhbIx4+lDikB6v4v AT2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="z8bR/V26"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gv9-20020a17090b11c900b0024bfa14eaaasi1098143pjb.51.2023.05.17.00.03.04; Wed, 17 May 2023 00:03:17 -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=@infradead.org header.s=bombadil.20210309 header.b="z8bR/V26"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230032AbjEQGlc (ORCPT + 99 others); Wed, 17 May 2023 02:41:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229647AbjEQGlb (ORCPT ); Wed, 17 May 2023 02:41:31 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6667C1FE7; Tue, 16 May 2023 23:41:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=CykYlbUyBmsKpsUHUyxIc0LEz/CT+ai84PogzOUldYA=; b=z8bR/V26LFSYbui7hpcGxPXyCE K+EqwK9dVITZUK9ukOXcaCWNNfqgU/KJ7e+JSCtIYcclkNbCis7+uJttuQhRKsnowxuzFn7m90i5Z qpB/+Un0orP8guRw1G/iwV5dbOX2VM546ecPbhqW8x6IwJf3SNklX5TKwn9pHv3a2LA1hkY9XnJNZ JyXI5Y4ykRsXoWTmdqa+Plc7H5pwYJe/4yypbhfmmdx7q82Si9rYhA5yYz7NKUt899gqVYeZojZlG lHRgh1cB7UlHFbktMnNiCTo8Lhp9rT0fGHGgFJHierOjC2gX91Gw0N6y01Ot4ruNsAxNxaO4QSrFu cmNo5kPA==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pzAqk-008VgM-1e; Wed, 17 May 2023 06:41:26 +0000 Date: Tue, 16 May 2023 23:41:26 -0700 From: Christoph Hellwig To: Baoquan He Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de, christophe.leroy@csgroup.eu, hch@infradead.org, 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 14/17] mm/ioremap: Consider IOREMAP space in generic ioremap Message-ID: References: <20230515090848.833045-1-bhe@redhat.com> <20230515090848.833045-15-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230515090848.833045-15-bhe@redhat.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Mon, May 15, 2023 at 05:08:45PM +0800, Baoquan He wrote: > @@ -35,8 +35,13 @@ void __iomem *generic_ioremap_prot(phys_addr_t phys_addr, size_t size, > if (!ioremap_allowed(phys_addr, size, pgprot_val(prot))) > return NULL; > > +#ifdef IOREMAP_START > + area = __get_vm_area_caller(size, VM_IOREMAP, IOREMAP_START, > + IOREMAP_END, __builtin_return_address(0)); > +#else > area = get_vm_area_caller(size, VM_IOREMAP, > __builtin_return_address(0)); > +#endif I think this would be cleaner if we'd just always use __get_vm_area_caller and at the top of the file add a: #ifndef IOREMAP_START #define IOREMAP_START VMALLOC_START #define IOREMAP_END VMALLOC_END #endif Together with a little comment that ioremap often, but not always uses the generic vmalloc area.