Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp1177343rdb; Fri, 22 Dec 2023 18:39:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGz9Oi981yXgilGFI3tpGlBTqpDgZxOXGpcgAGaymv6bDfmgIvcE+4ck23duLX+fu9l66h+ X-Received: by 2002:a05:6e02:221b:b0:35f:dd3a:8410 with SMTP id j27-20020a056e02221b00b0035fdd3a8410mr3447254ilf.12.1703299141155; Fri, 22 Dec 2023 18:39:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703299141; cv=none; d=google.com; s=arc-20160816; b=EbYU+LKVYnuUsH3R0agMQOvD7IojibTFeYYGdrXLF/VDvgc3OaVBNKbpX4VScn9QKu 1qrhYWDoQNf+yatKNb4QjP4tfvSfiEcIPo6rBoMwy/TPnA18av9ICVChcceSuz2GXD4e djidAsYAPzk+bs9Or2TBP8eGWgcFUXObwIlii+zHXUzBTUX0n4+caKh+AsUOa1N3lX3F W3OAFrFSZ9/IHkgJMZk7CHDoGdYuGK9oiOsdIJHXBmgRqeUQ58JwYKoFx9Pr/iriScce 4sJkZ9V7UvVnh4YrRWpG0XJfMcr9FSOkXY44BdE3d/CLhahKe4vl269jH99MuUcWGWry F2+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=S5vCi4r2L1AZ9tOo/sDNh5zQW34LqPi0CiBQXbC6glQ=; fh=A78Ob4OkQhcrc9fF2kCzUxJhWq20+Me+Hfow3c50/jM=; b=suOuGUkpDwcBluWXbGiBXp4T7oUgh0DHDsOvZVUXQ8alPdwUmvzCKNtzLlwmHXz2p9 HptZ776/VKoNYJdmtZgOKIbaUKBy91kY13qxAZ+cEQM8fBHOj5gidoqYe1nOtWAHRKgb 5ENGibcyYww+2lnFBMs7/NOQlmKE5L7wwMxluK9V1kGFkCBcS2cGhfV/r9wIoJfw4DGq 3pkH++mKWEJ20jehNEXCHrHjg1k3gHacux2KNUhBQyBbhLdSmmXSEjgcMRPNZh+UnCT4 HmmLHFOKVWJxyjW4lr2lxGx5pvrRtFsYJYL8P31vakzsKfCTjC9GpK04U8OqbKgq3l6x 2vRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c6avuW8u; spf=pass (google.com: domain of linux-kernel+bounces-10210-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10210-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s4-20020a170902ea0400b001d41642e478si2508910plg.620.2023.12.22.18.39.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 18:39:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10210-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c6avuW8u; spf=pass (google.com: domain of linux-kernel+bounces-10210-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10210-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2931FB211ED for ; Sat, 23 Dec 2023 02:38:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C86E6EC7; Sat, 23 Dec 2023 02:38:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c6avuW8u" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE16E391 for ; Sat, 23 Dec 2023 02:38:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67D23C43391 for ; Sat, 23 Dec 2023 02:38:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703299128; bh=ssxnbrs5lADEShxHeiKZ8wSBXwAdgfEiXXPglxhgwOc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=c6avuW8uy5XifohaPpgHWSrPD9jmiJML7ekXvrmQvcSLRPkqXYLvZlyc6iLOFX0ct lgh08EXQqV3Fl1IJO6HwjV5zFPSgBSXhNh9PWptfdYtULpSPsP22++OBRLqROktoA0 Lb+FeUwWkqHLSXQOjIOhBdu9HzuxZcP0pl3HHTmAR66rIgNjW4FJE69d4QodHiOohI SBIMOgGJgL5N/BqaNEmlUyVdEG03LJiwdJWTS0/nJmVAYeCLqHL73WrrKZh0r4Xtot 0Sv3ISfrTrNNs69VvY91QPCmEKiOwqradJCUbXFCp+q+8vge/6n3Y4z/XtDG9nPYA7 eLXXTBqBKa0ug== Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a1915034144so299636566b.0 for ; Fri, 22 Dec 2023 18:38:48 -0800 (PST) X-Gm-Message-State: AOJu0YyBT2ymdrZJvReypHCgs6vebgaa5WBmycwQIQ1WSDAMp/OEtybm 0UnposCHjFoZe7GRhmnWTa535/UHWG8SDU14bAQ= X-Received: by 2002:a17:906:e20a:b0:a26:9963:5e58 with SMTP id gf10-20020a170906e20a00b00a2699635e58mr1287608ejb.69.1703299126789; Fri, 22 Dec 2023 18:38:46 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231221154702.2267684-1-guoren@kernel.org> <20231221154702.2267684-5-guoren@kernel.org> In-Reply-To: From: Guo Ren Date: Sat, 23 Dec 2023 10:38:35 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V2 4/4] riscv: mm: Optimize TASK_SIZE definition To: David Laight Cc: Leonardo Bras , "linux-kernel@vger.kernel.org" , "paul.walmsley@sifive.com" , "palmer@dabbelt.com" , "alexghiti@rivosinc.com" , "charlie@rivosinc.com" , "xiao.w.wang@intel.com" , "david@redhat.com" , "panqinglin2020@iscas.ac.cn" , "rick.p.edgecombe@intel.com" , "willy@infradead.org" , "bjorn@rivosinc.com" , "conor.dooley@microchip.com" , "cleger@rivosinc.com" , "linux-riscv@lists.infradead.org" , Guo Ren Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi David, On Fri, Dec 22, 2023 at 7:52=E2=80=AFPM David Laight wrote: > > From: Guo Ren > > Sent: 22 December 2023 11:25 > ... > > > > +#define TASK_SIZE (is_compat_task() ? \ > > > > TASK_SIZE_32 : TASK_SIZE_64) > > I would remove is_compat_task() in the next version because your patch > > contains that. > > Does TASK_SIZE get used in access_ok() ? > If so the repeated expansion of that 'mess' will slow things down. > > OTOH access_ok(ptr, len) can just check (ptr | (ptr + len)) < 0) > and rely on the page faults for everything else. I mean, I would remove is_compat_task() optimization. test_thread_flag(TIF_32BIT) -> (is_compat_task() ? Sorry for the bad wording. Leonardo's new patch series contains the optimization on is_compat_task(), so I canceled mine. > > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1= 1PT, UK > Registration No: 1397386 (Wales) --=20 Best Regards Guo Ren