Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1709558lqg; Mon, 4 Mar 2024 00:56:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWXcjEEazaXGCQeHwJ7J/kQ17ia3j8LfYnKt3dcjHwK/EclPag4o4ikg5cZNq+lmCAIvKPpcrZ+tF9XEgbuywACb6z3ZZTBBsJjblT7JA== X-Google-Smtp-Source: AGHT+IFu6WmEd1HjnwVWGv6ExXHtu9mLx5YG8JFke+bHhLxX8LGhvFJ6EFivw/13MDcWac1QxE+l X-Received: by 2002:a17:907:11c4:b0:a44:b96:2811 with SMTP id va4-20020a17090711c400b00a440b962811mr7376455ejb.29.1709542591696; Mon, 04 Mar 2024 00:56:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709542591; cv=pass; d=google.com; s=arc-20160816; b=eE/8GWjEwC7+voBSt2b1tdmBzgQCEkbI4Pb/dSdRkxP+jdW7PSAK+6aMi1kSinZsEQ 8CqN2X4oJrzgVxyfiXFCGhk8VmvJrGvrrG6gKydMfOjOAAuks9FZgTk6LZwqAUlj/BYD 156Gi3nMhFUiptoJz1f3zqQjsYlVbMLtNV6Vmjy6im9PBZv3yIoLWrZ9ltG2UjSKKTI8 yWhTo2u6ke32EAWhfoFSNV2RWQ5Fwcsv9k7XYXlcEf560xDjiySIx/UTPOiNscgD4l8K RZX+zQTuzGar6ExxMcPzK/CobqPl4O1KEDH5pjhd4A5taWKEOVBOmUD4O3pf1T4BfHv3 WSvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=NrHJbku+y4x3+Z+gmdLDSJzyRyTHdUB/1VT1DVhs+Vs=; fh=cB8hy9h77s3DhOStQqhEzSD886D02E0ucuWcz7j6Nbc=; b=OI1R/RmAoT2UbinFjpiqxS2cbuoqJ/bSwXq5AXQVlftgx3iwFVrZhSKaYu+PpPJbbg vBWs65Oe+Zy7SnT782g6RTA7iquZPHo7+D6NXhWFtLiv/ELClBBhbY6K28h10c2wZDYe gFtLwumb/586zu8YvRgW7sksLOt0Nj9Qo4ecxlLTmcAeB1dM635WUMnLuLuvUl0qKnVt Pgr6KGM2HaZ8LYLIUmbTL5UnyOQtZX6NYKS6VYfWeEtjEldWvqvjOAz9RmLedkCjg4db qOAhPccIdW5kaSAM/UxEUyz3HWUsFrxFzBW9rabxUL4Gqs6YkK2tO2sweM2cxFNyzdAn zAeQ==; 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-90254-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90254-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id mc18-20020a170906eb5200b00a43514b08bdsi3693012ejb.141.2024.03.04.00.56.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 00:56:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90254-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-90254-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90254-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 321451F22FA8 for ; Mon, 4 Mar 2024 08:56:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7FD521B5BA; Mon, 4 Mar 2024 08:55:59 +0000 (UTC) Received: from smtpbguseast2.qq.com (smtpbguseast2.qq.com [54.204.34.130]) (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 637371B5B2 for ; Mon, 4 Mar 2024 08:55:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.204.34.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709542559; cv=none; b=uS0YoDvov8lFkizKqucevE0z1AazaGYGyO4QkCqHaY/a+a9l52PZD8kFecByiTK8eHRqMw49mCkV4911ZTMRx8AwQ3T0KytbFVcVhyiitaenYDe6wTzmQOZ2D9LPnwKIkjKUrOg5zE/OcY3+hEFODDVgsScIxvfW95iz5VyMyds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709542559; c=relaxed/simple; bh=BCVH8caV3eJZnst0zjGp6cLMi/unVfiC59OWDvK3zu0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=r6E735SXoJrreCKvMhamOygU198DxThl4RU0NHwpsgJF3Emu7eC0QSV/Eb35fH4QArAPg9R4TMkYQsFtjL397teO9Q9KEVWhTROL/UZ0GC/L3vYOqvmByEmCpLv3CYgesQMSx8IjGgaAtI34E5CzOPApuK1zjAag6h/6oozObpE= 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.204.34.130 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: bizesmtp69t1709542507tx60w49v X-QQ-Originating-IP: j/t1lN4+T/EzHFlHMLaia4UWmdXBjku6RWJFXoUD+6s= Received: from localhost ( [112.22.30.30]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 04 Mar 2024 16:55:05 +0800 (CST) X-QQ-SSF: 01400000000000505000000A0000000 X-QQ-FEAT: 807rdhwoR6uy/+E3pBfzXZHZy374eWAo5dxa5PXnJBGPu1CMZTVkYdBWZ1Rfn WRqfAAXfqNtSoWjBKfW/UauMfOls/5n3cxyhJMpVSLNZEjIoTx0j+9wU8/Vvxi9VWknITPV ImI+R4cnzFhLl6gUbp5nL3pHJzR3fLr694h12Jtenim6uPNQWlgb/QRAlj3Kel9oqaQaRjm gvr03M1QiRV16oOlxNHUvHLE2r6rpkPlh6x/RfhmBHtCM3pvREXb05qEdDxCGek73M4FkRj NNM6c76GRXN/b4awzygIS2psbOwdspDed5M+oPqsdyfcWs++go01Sxghl+0sNzk95CXgxkA cbrEecG0CpIxp2gEEiuXSlBkSUoOfcm9MyzUFUiz2+rxPDmba89TDqTDYSA/b99YSCGG8jq RzOpGcW/epU= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 2245615275566401135 From: Dawei Li To: geert@linux-m68k.org Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org, Dawei Li Subject: [PATCH] m68k: Calculate THREAD_SIZE from THREAD_SIZE_ORDER Date: Mon, 4 Mar 2024 16:54:55 +0800 Message-Id: <20240304085455.125063-1-dawei.li@shingroup.cn> X-Mailer: git-send-email 2.27.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:shingroup.cn:qybglogicsvrgz:qybglogicsvrgz5a-1 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__ -- 2.27.0