Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8208858rwp; Wed, 19 Jul 2023 06:50:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlGQTv4a01H55a7xpku0+xQKeHd2o4ymML6A0DlSqB/s7pJeO/gyRdaU4015BKeMyZJ7ruZB X-Received: by 2002:a17:902:ce8d:b0:1b8:b3f0:3d57 with SMTP id f13-20020a170902ce8d00b001b8b3f03d57mr5662327plg.31.1689774631003; Wed, 19 Jul 2023 06:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689774630; cv=none; d=google.com; s=arc-20160816; b=TUxhD6KdFJj9z15Qc/UkBvNjcTTVinLRCvLDob3cqj0v1iOV7Ux8FOMevz8VaI8r9o CzJTCQURt0ejiy3TnvWnAuo7HaI/+hXGZqlfEqDTir+5xVyMWfOp6nKW/lt7hU5EBZE9 YupG6hMlcwLagleNkWdZnSFZHFSAxDVxzVgxS1vRW/XDnEJ8anGEhEIf13FQCQI20KbB idlM8YUUlyHiw/FdoyP9uyj1JC+dhivMJFx+Ha2vqPqYHtC21Q7UkRozE1Qpz90H7kGd Rv5HgQk3C5QLe1t5Ip/BrV0jq7rxhCvBOGGimdNe8rpy41zNu12QVDXN/9Mkj1r/UHnl ZRMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date:dkim-signature; bh=Uj4bycoHIi78Tfh9p5PlVQ04avMBcEsGppMMatw0U6g=; fh=2Gy82pf9YbY9EW6P9uIYLpNZJRV9LNUU2rouHB99EJg=; b=kbpYXkdhiv4vqjIVLf81YKEIykQKjrTDxQBW+g9crC5qpfaVAjldHDRhBY2849wZN6 NhloFu9Qvd/4hFmjZL6bogjYJRyxJm3tQ5EaccRzYX5hr1iUJ8Xo7rsPMBWSwRrRqGuw h+0v9NMgC3gzIqfq0CmKcuBmJSa1PW2Bp/9KeeNeQh6Mmitzz9LmbZtWkbQ8B1wifI+7 OPQJOJhQsdPCy7f2cafEFdIun76Vea19CFR5ueTTVxxiJQhdq2xp0RLOtp/CEAoqST7X Ezz973SVlLZPH4obx6c1tWBvQAOGWmxc5KqjZbHo/GwvGDwXKkfXcDhUT28CAZJiqOjk BETg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=CJrnhE7T; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a170903018200b001b87ecb0e5csi3634556plg.126.2023.07.19.06.50.17; Wed, 19 Jul 2023 06:50:30 -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=@gmail.com header.s=20221208 header.b=CJrnhE7T; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230295AbjGSNn0 (ORCPT + 99 others); Wed, 19 Jul 2023 09:43:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229622AbjGSNnZ (ORCPT ); Wed, 19 Jul 2023 09:43:25 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A1F2189 for ; Wed, 19 Jul 2023 06:43:24 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1b9cd6a0051so43831595ad.1 for ; Wed, 19 Jul 2023 06:43:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689774204; x=1690379004; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=Uj4bycoHIi78Tfh9p5PlVQ04avMBcEsGppMMatw0U6g=; b=CJrnhE7Trr0nlNCxZ6FHqOnklJL3pq5ya/g8BUqmj2ArNdHTcyWdHwtH3q+eK3gIdA F2LT4d11H0PEw+LgU+8f/C3zPwukCl2hJ9XfUpxCcGk4RTGadMyQWD3tWKT+cZKoEyOY 6OUHM6T2BwKCGljZ1dwOkIHrqr3reMjvxFI/kFGoYHTRFV8O1ECpZJ/4ABfETLag/RRe 7GCyFZK/OcqBVl2auOmO6W4Ema4K6EdVlLkyvnmPlhPnqxZAj+S91H3dN4VFYRwWYQcH SIO82jrJaXfflRhYWhtVVlILQbP2LmpgEJ/LpKLBn1WblL5xUCrvaYjALr3TZtbyOzUl 8NZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689774204; x=1690379004; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Uj4bycoHIi78Tfh9p5PlVQ04avMBcEsGppMMatw0U6g=; b=BKjMMK12FY9ziLmix0nqAxI1iYs9iB3FtK7jAO/R5z3hSr8ZQuiEE+3SwJ6E9QwgDE PVClSHyEcJ4Ke/aZotU+UysjngnUbLKziY/OSNjudZLhawqSiImVopZ7V2CY4B/nzbSK N46AyicgiLvPyw4QxMgZXetxwwXwtvGN+Ej8iBcasaNOfbW1xkyRGb1Tc9vwnecisklz EzP+GwSnDQW4oiIG/QwlseE/UTWFrK+pOZqbSC3fQfuRTJl5v3OEwMbHOjGfjNAetMVW KHhPf39jxfLT1i9RvSP5x/NEscuXAV8YHgTAb109XFYOZELqYiNGrkWdn8s5/r0kG/px +STw== X-Gm-Message-State: ABy/qLaJ1iAxWSIcSmIQCSseV7/uJ7lWbsxQ/mt/H9qFj/HGykYSRWTY zPISKnodiGaTKTyLoAmO8+A= X-Received: by 2002:a17:902:b28b:b0:1b8:6cab:db7f with SMTP id u11-20020a170902b28b00b001b86cabdb7fmr4807352plr.53.1689774203465; Wed, 19 Jul 2023 06:43:23 -0700 (PDT) Received: from ubuntu ([59.178.102.25]) by smtp.gmail.com with ESMTPSA id iz9-20020a170902ef8900b001a1b66af22fsm3991568plb.62.2023.07.19.06.43.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 06:43:22 -0700 (PDT) Date: Wed, 19 Jul 2023 06:43:14 -0700 From: Sumitra Sharma To: Patrik Jakobsson , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Ira Weiny , Fabio , Deepak R Varma , Sumitra Sharma , Alison Schofield Subject: [PATCH] Remove unnecessary calls to kmap{,_local_page}() when acquiring pages using GFP_DMA32. Message-ID: <20230719134314.GA7590@ubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,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 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 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