Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp309861lql; Mon, 11 Mar 2024 03:34:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVxqRy0ZaGuSQ+hzU2I8NfPa5AZU1LP9P2uIMTvMXXgMj1WFAuC7vX+m9TWAtSrRY68OuIe8XG7rz7TLM+bWhu0/Roilkv0u+3qrjY3GA== X-Google-Smtp-Source: AGHT+IGYamqyLeHLB3cV65WOWeYLGwbMrWQn5BUnP0r2sPr/FGEV8p1814YSY+GvuU5gw/qRa/Y1 X-Received: by 2002:a05:6a20:4328:b0:1a3:1462:3c50 with SMTP id h40-20020a056a20432800b001a314623c50mr3940148pzk.21.1710153264588; Mon, 11 Mar 2024 03:34:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710153264; cv=pass; d=google.com; s=arc-20160816; b=Futs3a/iolhpDEc9hN5Icu9kpmJASqw09E9HC9eOoaR8liQvOH17H5114k8Bn/av1a /UQ9yNGOdLsvdgNn4VtYqURHDwfewOw5+koOX1A4MbFhiqtb/fbalqUQkvQxwb7UJ2tU YXxv4A9g3SbrMVL9q628FkCiOTG/tYyg4lphXFd4J9plaAnWmeYW1GcqLRjIq2QWG6X1 7Ho32IHQs+RelxemmfrVOzuyaRv/DM41qobDSOvWRiKsgFMpMzoHQSvSbmUGO6yQ/HGi 6siPMT7tyrFjgvDamhmPIj1ZSd8RA+IAo3AJ6zJp8v1vgFXgviFX43wkgJzrv1CIlejw EDhQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=QFcQRXvNXTQRbWy8jv/fRKCuvKRlkFgDBJUmA9YehMA=; fh=Ijwf7GvQe+PLfzYg1x6w86O9eK67JWJK/Cf4KQtTzg8=; b=uFwiNKJeMbDcBrnP8782ypMuBf5PWBBY81LQ4IdRPID6iFjXw8H41ilukqFJ4gJbwa lJLT1gBMOWPTJPgQ3inDJXjbBlw+zE7tMskY7DFxD4yU/Nh1EgOUuizcG/Sa3GljEFND Gh8Xj99z0aH25Ld51uQwIlmq2TyUDRHuubAVX/Rydx5s944jWbhtsZ6F9IOO/94vuf2H ZYo10ug2s+ZR9O4XqhCjVFZItVCnjvcYVddzyX7ZigDJKkx6DoKDheS6XE05bwvJ1g3j SaeFrx3KFzyROjeeHMpT/m+ncwMyR8QldMrpUnr/m8a/mEegiaLGvxwGe+ddiPWoXtux 6+HQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-98703-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98703-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r2-20020aa79ec2000000b006e64ee70140si4536999pfq.219.2024.03.11.03.34.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 03:34:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98703-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-98703-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98703-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4372A282748 for ; Mon, 11 Mar 2024 10:34:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 16A713219F; Mon, 11 Mar 2024 10:34:18 +0000 (UTC) Received: from smtpbgbr2.qq.com (smtpbgbr2.qq.com [54.207.22.56]) (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 066F429424 for ; Mon, 11 Mar 2024 10:34:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.207.22.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710153257; cv=none; b=HJ2nu7Fsy7k0GI4/kpcpY9mWhhlcBIoUlLDqz/Lf/zAdEsoylFjTy9xrMTVZulkM4re4z4agGb0v2SjmMbRJI/lkUuLuCuAHulxfD17VPm+BCmQEsRtneRh54ef4/Bf/sRpGHKsN4RZyiWwNCdmtjeyMtYU39LR+/Xpc6V6nXMo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710153257; c=relaxed/simple; bh=oFMEHOkWMFDCGZTROsbokvN1VVNCxaDVvm72nFgHgf8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iEB2srPP++H66wJmTPExhrX7lxYLWMLzDhmm2D0ASWl9sEU/ibhogICNYrkgfqZTt8FUAsWL+GKfmJhw9IN7fmyIDiWV7G1W1w11x4jFIUm/il+QHtymO/v0OfAk6sw1c/LYVAJlu7yWoWxnB23GYnYb5L3mIkMjOd+TeSoxQCY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn; spf=pass smtp.mailfrom=shingroup.cn; arc=none smtp.client-ip=54.207.22.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shingroup.cn X-QQ-mid: bizesmtp66t1710153206tvsrkqhi X-QQ-Originating-IP: jDdszq3cBpJ6hHvCms7l9LVCaUzQEZWphdXYf+ovwKs= Received: from localhost ( [112.0.147.175]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 11 Mar 2024 18:33:25 +0800 (CST) X-QQ-SSF: 01400000000000505000000A0000000 X-QQ-FEAT: 3uhoZqdeMHP0xN020+GHgFDnKhe/jnLul9KSBfqte4048DuSaJQfNTK3/MPBu KXyw3fhchtcLl3oOSfkTHSiX7ZOyHQFhVuzHDee9PxIgOjZfwvizbr9fk1xZlSh4HgfrIte no9dEAvoKMuCer8BmizSnYeISnZEggVNoU4MjnqbKIVR4DwDLueJoChFZqDUiwU7MQhQ6lW 6B35Ge+hXXRZK/WEq10jrJhTejnzZ2xJYuCMrYbquwQeLTtcN5772yKMTnjzt3pFCkMd/kQ IlylnuBG+XHOmIhXitmBGNystnHx3eOpH11nyABSgRiUATSuQzoVDFYSEIyu7TXMdVKiWh8 HNG2Ijz9DTOLimQVI5V289dDvnQOFJy4hEvGSyvAu4+/X+2uMnUrQFO2hs9iQ== X-QQ-GoodBg: 2 X-BIZMAIL-ID: 4919900436153969483 Date: Mon, 11 Mar 2024 18:33:25 +0800 From: Dawei Li To: geert@linux-m68k.org Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] m68k: Calculate THREAD_SIZE from THREAD_SIZE_ORDER Message-ID: <1971996240D01975+Ze7d9TQIq9AFG2Wr@centos8> References: <20240304085455.125063-1-dawei.li@shingroup.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240304085455.125063-1-dawei.li@shingroup.cn> X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:shingroup.cn:qybglogicsvrgz:qybglogicsvrgz5a-1 Hi Geert, On Mon, Mar 04, 2024 at 04:54:55PM +0800, Dawei Li wrote: > Current THREAD_SIZE_OERDER implementatin is not generic for common case. > > Improve it by: > - Define THREAD_SIZE_ORDER by specific platform configs. > - Calculate THREAD_SIZE by THREAD_SIZE_ORDER. > > Suggested-by: Geert Uytterhoeven > Signed-off-by: Dawei Li > --- > > V1 -> V2: > - Remove ilog2(). > - Calculate THREAD_SIZE by THREAD_SIZE_ORDER. > > V1: > https://lore.kernel.org/lkml/20240228085824.74639-1-dawei.li@shingroup.cn/ > > arch/m68k/include/asm/thread_info.h | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/arch/m68k/include/asm/thread_info.h b/arch/m68k/include/asm/thread_info.h > index 31be2ad999ca..3e31adbddc75 100644 > --- a/arch/m68k/include/asm/thread_info.h > +++ b/arch/m68k/include/asm/thread_info.h > @@ -12,14 +12,15 @@ > */ > #if PAGE_SHIFT < 13 > #ifdef CONFIG_4KSTACKS > -#define THREAD_SIZE 4096 > +#define THREAD_SIZE_ORDER 0 > #else > -#define THREAD_SIZE 8192 > +#define THREAD_SIZE_ORDER 1 > #endif > #else > -#define THREAD_SIZE PAGE_SIZE > +#define THREAD_SIZE_ORDER 0 > #endif > -#define THREAD_SIZE_ORDER ((THREAD_SIZE / PAGE_SIZE) - 1) > + > +#define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) > > #ifndef __ASSEMBLY__ > Sorry to bother, but any comments on this version? I know it's awkward cuz it's in middle of merge window, sorry for that. Thanks, Dawei > -- > 2.27.0 >