Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp2065823rdb; Tue, 5 Sep 2023 13:19:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF3ch4BGhdCOjKNDzj4UPLggk0wJezJBlTKfnXHOmZuWa21pHH/Yn6dOpsghFgSdFzLeeW/ X-Received: by 2002:a92:d785:0:b0:34d:18b:aeca with SMTP id d5-20020a92d785000000b0034d018baecamr14273762iln.3.1693945151614; Tue, 05 Sep 2023 13:19:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693945151; cv=none; d=google.com; s=arc-20160816; b=CEI+Z2EOYvzJkgG0kdvdiApyjsagljemDcoEeDOHGNROvdb5Zq7+/A9AYjxYxcJURS D2yGgA6QgPtrAyDdWOYqaXmSqQvIPSVoJYMl6Xz5aQOPl89Kr0rzaxjofHsE/DFhk+oy WD3bS34oLoGy7TQdHsjZMn1sSRHatEomkWfrd1hepqft7OOrsUxm2b1eqtaFnITPKCOR qlwZAU7Acr5SByECgSLyN4gjs6o64kgGPa8txYc6a9yW4oborPHp5E5CcaS59ZSeqVhT HwHLMMUHuDC/PRmaHK8qz6G9MyZe8S3UqJddRtyxd1KAxEbTtTVnbHO30ezLGYk61qDZ KRcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=TWxCHtSQe16ZLHlUkM9Qy6J9w6zsVd7ZG8VkHH4Y2nY=; fh=Ki9hTsn9ZPmV9VahIegy0fDueJUz7xSL9dx03jruTKU=; b=NZk8xykqGfurByjWS0PMnUl5sJBKk76PV6HxL/pN88uZsSNiDn8zh1/t7rUaPIDI5r lLHacUO2UXpmTNsWoha1z2gtkCxXCradbVYQKC5KM4gchmkpj0WnfSIAoyxfzwNrqDUK 8NW6VwLWHhIVOJL8TM9geQTR1sRTgOGg2W0zGo7nQo9G4XljwnQiAbskm9TPD5U99IJb 9zr0wjnsS8ZzZDV6f8mY41tuXQ/2ZiBodHjILiVRS180dGHya5E2X4hCA65Zwziu/rwi OVKjvNTUGtlpOFtCNpKG5i1SC3R+MToYrEmKl7LE8Avyur2e4SU5V028aBeXtOljj9QM Oc/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UPiAsuAV; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ck13-20020a17090afe0d00b0026822221502si9956213pjb.163.2023.09.05.13.18.57; Tue, 05 Sep 2023 13:19:11 -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=@kernel.org header.s=k20201202 header.b=UPiAsuAV; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241539AbjIEQKK (ORCPT + 99 others); Tue, 5 Sep 2023 12:10:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354358AbjIEK7F (ORCPT ); Tue, 5 Sep 2023 06:59:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C1AB199 for ; Tue, 5 Sep 2023 03:59:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C0599B811DD for ; Tue, 5 Sep 2023 10:59:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F05CC433CD for ; Tue, 5 Sep 2023 10:58:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693911539; bh=79TkLJodoCPEQAJcz0Moo8+UMv5TsS+bIcz1TUl2nWo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=UPiAsuAVVgoqF0/+7umxpSJPuy3vId12aZ9ItJ8pT157KQj1qIdSDjrrOLnKZQMX6 TfquVGL4kj+wTxPkehZHY2jwkHxjXIJlpSqvLl2pSMfDEnH8nEOGcPMpZhHpXESplC H0u8VFXJA7lmKsuRLjFUwcV0CGLvmmROKZ9aDloBosICXA6kf3qruwm794StJfA6x/ yxUqBXCvOhg4zuneRcO7mLfLq9uZpxAHzmfg2eIOGwqQSq7CikzVktNUw4ZPpzvhgk TJxZSybxLBugv+NfVOsfRL0WVd0QLixk82jdGrjBWt2dYas/TZLw/Rw2Z9/3rIoBlI 7B00ZBcIcJNdA== Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2bcfd3220d3so34442721fa.2 for ; Tue, 05 Sep 2023 03:58:59 -0700 (PDT) X-Gm-Message-State: AOJu0Ywwb7qIkRQ5o6QsnX1mZ57nwIdPNmXepPMuQxQ6Rd+lZrGMOPRZ /i9MDo43BdvEkpYN3ipadazn1NWI2cPd0EQiwVA= X-Received: by 2002:a05:651c:238:b0:2b9:36d5:729c with SMTP id z24-20020a05651c023800b002b936d5729cmr9549657ljn.47.1693911537433; Tue, 05 Sep 2023 03:58:57 -0700 (PDT) MIME-Version: 1.0 References: <20230905080147.1625448-1-maobibo@loongson.cn> <20230905080147.1625448-2-maobibo@loongson.cn> In-Reply-To: <20230905080147.1625448-2-maobibo@loongson.cn> From: Huacai Chen Date: Tue, 5 Sep 2023 18:58:45 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] LoongArch: Remove zero_page_mask symbol To: Bibo Mao Cc: WANG Xuerui , Andrew Morton , David Hildenbrand , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 Hi, Bibo, On Tue, Sep 5, 2023 at 4:01=E2=80=AFPM Bibo Mao wrote= : > > On LoongArch system, there is only one page for zero page, and > there is no COLOR_ZERO_PAGE, so zero_page_mask is useless and > macro __HAVE_COLOR_ZERO_PAGE is not necessary. This patch removes > zero_page_mask and macro __HAVE_COLOR_ZERO_PAGE. > > Signed-off-by: Bibo Mao > --- > arch/loongarch/include/asm/pgtable.h | 4 +--- > arch/loongarch/mm/init.c | 9 +-------- > 2 files changed, 2 insertions(+), 11 deletions(-) > > diff --git a/arch/loongarch/include/asm/pgtable.h b/arch/loongarch/includ= e/asm/pgtable.h > index 06963a172319..342c5f9c25d2 100644 > --- a/arch/loongarch/include/asm/pgtable.h > +++ b/arch/loongarch/include/asm/pgtable.h > @@ -71,11 +71,9 @@ struct vm_area_struct; > */ > > extern unsigned long empty_zero_page; > -extern unsigned long zero_page_mask; > > #define ZERO_PAGE(vaddr) \ > - (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)= ) & zero_page_mask)))) > -#define __HAVE_COLOR_ZERO_PAGE > + (virt_to_page((void *)(empty_zero_page))) > > /* > * TLB refill handlers may also map the vmalloc area into xkvrange. > diff --git a/arch/loongarch/mm/init.c b/arch/loongarch/mm/init.c > index 3b7d8129570b..8ec668f97b00 100644 > --- a/arch/loongarch/mm/init.c > +++ b/arch/loongarch/mm/init.c > @@ -35,14 +35,8 @@ > #include > #include > > -/* > - * We have up to 8 empty zeroed pages so we can map one of the right col= our > - * when needed. Since page is never written to after the initial= ization we > - * don't have to care about aliases on other CPUs. > - */ > -unsigned long empty_zero_page, zero_page_mask; > +unsigned long empty_zero_page; > EXPORT_SYMBOL(empty_zero_page); > -EXPORT_SYMBOL(zero_page_mask); > > void setup_zero_pages(void) > { > @@ -60,7 +54,6 @@ void setup_zero_pages(void) > for (i =3D 0; i < (1 << order); i++, page++) > mark_page_reserved(page); > > - zero_page_mask =3D ((PAGE_SIZE << order) - 1) & PAGE_MASK; In my opinion it is better to combine two patches to one. Because this patch can only work *accidently* when 'order' is zero. Huacai > } > > void copy_user_highpage(struct page *to, struct page *from, > -- > 2.27.0 > >