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 F06D5C77B7D for ; Sat, 20 May 2023 03:28:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 24BB0900005; Fri, 19 May 2023 23:28:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FBE5900003; Fri, 19 May 2023 23:28:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C69C900005; Fri, 19 May 2023 23:28:55 -0400 (EDT) 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 EA836900003 for ; Fri, 19 May 2023 23:28:54 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id BABC0140807 for ; Sat, 20 May 2023 03:28:54 +0000 (UTC) X-FDA: 80809201788.03.57B8116 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf20.hostedemail.com (Postfix) with ESMTP id DB6B31C000A for ; Sat, 20 May 2023 03:28:51 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=aoAZGRsw; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf20.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=1684553333; 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=9tGnYz1bwiUJEY8iexdjytwpnYdRmD1r1uzK1JlxYiY=; b=VxTiErqJIKsgV8oU43F5tXi26mEqtPDPzO05/bIowlURGS+3NX9UmeRw4t6GmoD4hLbMwo 5oVncffDnMuHtmntUQLey4+LEVsfCgibG2IZSWVqMi8Jz0c5AdWiSvjt7avZhqD8Gl+991 dvhbt8fp4tOAFoR5k2g/3PF7yrB+yfM= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=aoAZGRsw; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf20.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=1684553333; a=rsa-sha256; cv=none; b=1gtSrxblfjuk6yjW5w+knPATjYV5p3k0LvHuPZrClVE3N2eypbpx6edsZ8GY3ETKVMUI7T pV2U5pzI3jZYLDSjEa06nSJeHOcs9XSLwrOPEyFl8Rs1CS4CYK+cqqkD3tjDs/RZOEnldz hOb66mHp5LjrJ1aIsxx4o4LEc01hSVM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684553331; 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=9tGnYz1bwiUJEY8iexdjytwpnYdRmD1r1uzK1JlxYiY=; b=aoAZGRswH8o26TqSxehpI4P/o+5YomH7KG/aGQjrWaT+knXp07vciceYlibHDL4CEiWY21 xGGJxieve6qlOw2plNevbCbqaH4a0bYiBCZwh8PBzkMQzyQZTUTpeqZDZ07TocgUo7YCjO nInxewOhNv+EAg9SeDNKpysxK8T2AtM= 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-62-tegY8KViPSqd9FFeRdOa-Q-1; Fri, 19 May 2023 23:28:49 -0400 X-MC-Unique: tegY8KViPSqd9FFeRdOa-Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D8524800141; Sat, 20 May 2023 03:28:48 +0000 (UTC) Received: from localhost (ovpn-12-79.pek2.redhat.com [10.72.12.79]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CBE33C54184; Sat, 20 May 2023 03:28:47 +0000 (UTC) Date: Sat, 20 May 2023 11:28:44 +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 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: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Rspamd-Queue-Id: DB6B31C000A X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 59m5wexdezcergfqytob64tdr3awrg6f X-HE-Tag: 1684553331-178174 X-HE-Meta: U2FsdGVkX18tDBIbVTDzBeEKZxiupvhwxAztlREZVPpVG8qAoG1r8+SJsdSE56rAKP7RI2aIf1pRO05bxLdA+8DdAPA2W/esweMwYSHbN2NU0EL+yeLDxfB5ubCcMvRMaBJsJD/PcMiGSqhjR3vLmvSDsyunH2fffpKk43MCEg7maJFBX+4ury5DUeLIynMX/o0IU7HJSoUJMGyqiEIZEHFun6saBq0CWwHUNK6dcqMPX4lPc+SAOng/Bb0Fhri8d2NRLMx0GpamQJeJ0PA8vRWKswQFzPVL4jAOyAUGOcFVImLMNfPzlZZNtEqlho/iougWH7jjFYExq6hO+BKEPnIddreP9e84b6PGLZXBUCCj3yuXf4/P9pu5d2UHRgmACGSSuArn88gWvwgpxMALFusGKHkGXbvOKhjpmB1FqBiS4MiBBnywo8tVZnsbwot67zQ+Z5riVizBSdPCm2xNl3C6oG8pWB+CHX6cCmy8FbUchNsbyh5qAyMfUuRygKkKZ2HpyIy+/O4UTaasUKK2idIgzm/wmvBfpBpx3HU+Ex38kp5ObmayUd6DXE8pWJJlq8R00Ny97l7YvaOBmvWge58ndrVWvMp+rLzOFB1mLZe7AkRWi7RsIIJaorh08U9dGTgEazR0i1ISoKoXKH1PQitrheJy14luScvlzSzzrCMMCQpxMv8DfJsLErY2E8cASSOqT/R+CBGjr/KTqvZylE0FbPXFgCmNu1jpdlNMasFRBv8QJJ42tcoCz0Ws5nJa6fXv2cG7GyzHp7BnNxHP/LLG7s4+V9ox8WvkTk9Ksaxq83t3If9ZIcKtIAVTR9e33rELACR0OwJibXm4x8ohss4eT7apyMAQTZ4Gf7Ia2j9JGEdkLaHbOEx0h7atCt3ur0Gjm4CD0DFeMwGtEBefHLP/0R81iwgjfSFJ5UGxOa8lIjiPMOLlgDx/X/u7FzNnJjht/lBbwbtjOlI6hOh vKgCgueW pONc0nGH6w1QEGAOs5qKVE5HkT6oqlR9dwUU8w4J93J1rIddoMkXlnSPqweDnljwsLORvYHn4dvhUsmxZOacDgsn0/5eve8bOFmF/YI5QJWAKto9q8KN0CKnIyL4PWREby7KEAT5FMPG6NQTCC+rutQlSgMgU0aMwGU/FO9mg2zVIO2+46W3WFaQerM7UprIsXITE0H9+NjeY8zY= 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: On 05/16/23 at 11:41pm, Christoph Hellwig wrote: > 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. Great idea, will do as suggested.