Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp2591244rwo; Sun, 23 Jul 2023 19:52:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlEUJ2vJngw82rAZeYdEVZzbqioMwnixUYjZCpFpbSVFixLzWnEDbncjDIm+BRDWadm2nK09 X-Received: by 2002:a17:907:2bcb:b0:988:7d68:9fee with SMTP id gv11-20020a1709072bcb00b009887d689feemr8211614ejc.34.1690167173830; Sun, 23 Jul 2023 19:52:53 -0700 (PDT) Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l23-20020a170906a41700b00992e520a593si5362936ejz.1004.2023.07.23.19.52.29; Sun, 23 Jul 2023 19:52:53 -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=@intel.com header.s=Intel header.b=S1lIoOtD; arc=fail (signature failed); 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229845AbjGXCZ7 (ORCPT + 99 others); Sun, 23 Jul 2023 22:25:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229577AbjGXCZ4 (ORCPT ); Sun, 23 Jul 2023 22:25:56 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0989A6 for ; Sun, 23 Jul 2023 19:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690165535; x=1721701535; h=date:from:to:subject:message-id:references:in-reply-to: mime-version; bh=lUCta+26jqDbeYHTQfK/cSnp5PJTGG36JXi5JkKvqHg=; b=S1lIoOtDzF6A6N57eaKH/uYcfLCO9qU8YDmx5QOxkfh9SkfdKtbobZuG Er61ix2lzj024OfqL5cq9l1CCTakNpMWpEbGZpCEM6fBGSHAm+JnlA66z wfnZkBtteKn6YVEhzWAWJHMVLBHje3e1y1LPu76HYOvV4KxdjCYXHFSse JBabLHxfUY1GFiFP+wrl0bS1DGuAK0JJF/MCrnhHejncGGIFzk+BHQBxk 6nRjTNvyTPz+Jgt00JGN2zHBhgoqg9XbOrIVN+/jZUicN/YPgSRPJ07rw 5k9wLRXDF3ME7LhnLX2z8Ha5m6oizOyNdrSyzORC0t/f0oMsTBtLOtBtz Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10780"; a="398230245" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="398230245" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jul 2023 19:25:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10780"; a="839271096" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="839271096" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga002.fm.intel.com with ESMTP; 23 Jul 2023 19:25:18 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sun, 23 Jul 2023 19:25:17 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Sun, 23 Jul 2023 19:25:17 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.173) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Sun, 23 Jul 2023 19:25:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J7ML6EOxotF1vA31kGWjM4jeIgWWmYvzchM6IvDP52v4hbKAiNDOCZP2mpx6qTbEZU3X7KWgopOXlfKPgZPb3uv9zHoGTIVIEb0HQHmFiOl28w5FviKggS53V5DaS0VB/iOYXp9MgTQc/WylzH/8YhuHMpCLpTmGitR7rAK4ajznCDJ2GmSuxqJjztRpTBx+GAA8PVCuK+m5ahfp7CB/krREocsjPsnCcyO1ixD6f7C8ebavmBf1fElhNkMEhJRd3ShXHRBZzWTJQDdbFt6PvVUMAPtC3Vgkxte6igFHR46LjUQuJZds47+DzhTpt9rm2jrYLSB7l+TL1JUv5I5wTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o8PbJm35CpaBCw0d3WBf2dKR3iT/9kbp23QGchXvS94=; b=dV7gwDE57l1WTcVqc908+ip95O0Ed10nuDbQBgaPs5sE/YwZAPDrjuiV2tfWrUyaaClBBwl7iD73FTdgi8MHdB3bnRXCnNXm3ygVyiQFze0MybTatEApms6Ihsz0uoMEF2/VdPmuFv6F/NiLJpdfdw34zTtd9EPQZQyrM3k0iuJrQYrQFMEA0NocXPyi9eF7JdiiaYfSiOc5eVDb1UH/y3m4v4DZQ/SdyJt5/ijUWj4RqSgNouFXNXnWrI7i7kf7Aj3HTnSQXawzv1XdZYzYURS9pMBF+QkqNmy2mXDBioZ+wDdt96UZ7eTjWWUWuwlXl00S1Kn5QmPJDiP5HOAocw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SA1PR11MB6733.namprd11.prod.outlook.com (2603:10b6:806:25c::17) by PH7PR11MB8480.namprd11.prod.outlook.com (2603:10b6:510:2fe::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Mon, 24 Jul 2023 02:25:10 +0000 Received: from SA1PR11MB6733.namprd11.prod.outlook.com ([fe80::6da5:f747:ba54:6938]) by SA1PR11MB6733.namprd11.prod.outlook.com ([fe80::6da5:f747:ba54:6938%6]) with mapi id 15.20.6609.032; Mon, 24 Jul 2023 02:25:10 +0000 Date: Sun, 23 Jul 2023 19:25:06 -0700 From: Ira Weiny To: Sumitra Sharma , Patrik Jakobsson , David Airlie , "Daniel Vetter" , , , Ira Weiny , Fabio , Deepak R Varma , Alison Schofield Subject: Re: [PATCH] Remove unnecessary calls to kmap{,_local_page}() when acquiring pages using GFP_DMA32. Message-ID: <64bde1026a0af_7a6c729452@iweiny-mobl.notmuch> References: <20230719134314.GA7590@ubuntu> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230719134314.GA7590@ubuntu> X-ClientProxiedBy: SJ0P220CA0011.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::31) To SA1PR11MB6733.namprd11.prod.outlook.com (2603:10b6:806:25c::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA1PR11MB6733:EE_|PH7PR11MB8480:EE_ X-MS-Office365-Filtering-Correlation-Id: c2f3fa96-5fa5-4e3a-c561-08db8bed33dd X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8eyaPjdrjrdqLzR3ByFSevdxslRkaph1+lpGKLuuacmFKMZH4Im+dXDwK9Lk7GhljM3kh9jhhbl1LOYo0pscfKr/6OA5Qhd+UTRLZQLs15m3HWfHbliJ+Xpy/tQJDcx0lOtqHQUMNHxi2Wi0XaMECJwqSa/J/pdof8Vm2podAQBTSIdJKAURdfXvMr2y+5+fBNqKW4z4/CWjGEe3SPYwXTD6WEsDAoGlFhrsmSpupvvhVvIj7q4dAAUX7DyOAyVNuzNCZAkp+vmdwIgnK7PiCOiHGK87sl6tTAGn6w5zzAKaJKgj4DHYmeomy7clSbElpt8NHFno05F+019dL4TIGZ8Cr8C4oeRNrsHjL+fnp+L/nYTubrWwjZN0pcA7SLZKT4zTJN6LIW60MpZL3NZ6tgnbIWtv4IFaATOdus2hUr7Z+Nr16IvMCCj8GXpVawwzZfNn1iXc2Axcgi5Ern5iOHtugb0LuYIwm4rox/dMURHjxqoISgdOEqcT0N1En6NyVUuq2I302ZABzji5h4eGjixLJrFynfuqrRTLimR++gzr6I3VQ4/xKlq2rogCAMphsrLszxF5qzU9DFv5sBb3bA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR11MB6733.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(136003)(376002)(366004)(39860400002)(346002)(451199021)(5660300002)(6506007)(186003)(26005)(316002)(6636002)(66476007)(66946007)(66556008)(41300700001)(6486002)(966005)(9686003)(2906002)(6512007)(6666004)(8676002)(478600001)(8936002)(44832011)(83380400001)(110136005)(86362001)(82960400001)(921005)(38100700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-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/Ap5L8SYItHNlwA0KMAzM6NOrCTUVOwUzi2HYglq?= =?us-ascii?Q?GwYu8ZZtg8lfC1aax1lrdEdPCuRAQkOwbEI4FXSNirzJ+Z/iGPxxHHUfeSIG?= =?us-ascii?Q?J7Bvgp1azIKNWGvKUdLI2FtU6SFPlbKxJzt2ZUG4eaxpN2M/AScQJROnqkQq?= =?us-ascii?Q?56f+uERYbCAabk2H2H8MMVUxbBBGgdAWTpQVLP48kqU2kelgJA2HMBQZuxlM?= =?us-ascii?Q?WtdxWIJdDDqtjEZgVn7MbsDnDKgUkLkTCnntnz9M4GGY5cmxq9wwjRh8X21X?= =?us-ascii?Q?0BkitoxXQ0X0SqGLNTkZC5nsOOUeEYBeJBdOB3oqGObT2fVbO6xJVjqkPbNv?= =?us-ascii?Q?QLYrjPueLxy6/+c8dixt9yHGNNFXuTBft8H0SCpd+aRI6NJvBwJFQ4nPku/E?= =?us-ascii?Q?nFjIluQukXB55TM/OBL6N8C2bIaTknLOWniN1ZbdTlrAdYHdhU6780AGcmFd?= =?us-ascii?Q?QReZpLRbIsLwUEAZEjklzFnCs63xVtbPhAPFh28TV1t40krCP/zJ27v+O6Q3?= =?us-ascii?Q?/89Q+YjVejlUTnSsDswoHriDBm0bJHE5kyZ0f/Db0PkMam76Xq4Vqdlpz7oO?= =?us-ascii?Q?vxT48MucnvlRSPq93c9oYPaBXYcGbIhcXOZkltgCJmTHE994wJiKC4FXYJQJ?= =?us-ascii?Q?5hfhap3d2CUl5bluqClHtp9bBVaXEKeUyi8l01Yw46hugjXzH6I3VxrfyfvC?= =?us-ascii?Q?YCeYlqAa+3dlky56hHHpmSP+U2LNjelu+N80GfYv?= X-MS-Exchange-CrossTenant-Network-Message-Id: c2f3fa96-5fa5-4e3a-c561-08db8bed33dd X-MS-Exchange-CrossTenant-AuthSource: SA1PR11MB6733.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 02:25:10.0716 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xxqJzR5Gcn7iaykXaBSbL9F/5xBEMrPPKoFDcGA2Js7Fgcy+gVYXoXg3RLR8QmjIOLxsYzYWM9m5Hq9NmlR67w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB8480 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 Sumitra Sharma wrote: > The GFP_DMA32 uses the DMA32 zone to satisfy the allocation > requests. Therefore, pages allocated with GFP_DMA32 cannot > come from Highmem. > > Avoid using calls to kmap() / kunmap() as the kmap() is being > deprecated [1]. > > Avoid using calls to kmap_local_page() / kunmap_local() as the > code does not depends on the implicit disable of migration of > local mappings and is, in fact, an unnecessary overhead for > the main code [2]. > > Hence, use a plain page_address() directly in the > psb_mmu_alloc_pd function. > > [1]: https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com/ > [2]: https://lwn.net/Articles/836503/ > > Suggested-by: Ira Weiny Reviewed-by: Ira Weiny > Signed-off-by: Sumitra Sharma > --- > drivers/gpu/drm/gma500/mmu.c | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/gma500/mmu.c b/drivers/gpu/drm/gma500/mmu.c > index a70b01ccdf70..1a44dd062fd1 100644 > --- a/drivers/gpu/drm/gma500/mmu.c > +++ b/drivers/gpu/drm/gma500/mmu.c > @@ -184,20 +184,15 @@ struct psb_mmu_pd *psb_mmu_alloc_pd(struct psb_mmu_driver *driver, > pd->invalid_pte = 0; > } > > - v = kmap_local_page(pd->dummy_pt); > + v = page_address(pd->dummy_pt); > for (i = 0; i < (PAGE_SIZE / sizeof(uint32_t)); ++i) > v[i] = pd->invalid_pte; > > - kunmap_local(v); > - > - v = kmap_local_page(pd->p); > + v = page_address(pd->p); > for (i = 0; i < (PAGE_SIZE / sizeof(uint32_t)); ++i) > v[i] = pd->invalid_pde; > > - kunmap_local(v); > - > - clear_page(kmap(pd->dummy_page)); > - kunmap(pd->dummy_page); > + clear_page(page_address(pd->dummy_page)); > > pd->tables = vmalloc_user(sizeof(struct psb_mmu_pt *) * 1024); > if (!pd->tables) > -- > 2.25.1 >