linux-snps-arc.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Min-Hua Chen <minhuadotchen@gmail.com>
To: Vineet Gupta <vgupta@kernel.org>
Cc: Min-Hua Chen <minhuadotchen@gmail.com>,
	linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] ARC: fix incorrect THREAD_SHIFT definition
Date: Fri, 12 May 2023 01:01:38 +0800	[thread overview]
Message-ID: <20230511170139.343434-2-minhuadotchen@gmail.com> (raw)
In-Reply-To: <20230511170139.343434-1-minhuadotchen@gmail.com>

Current definition of THREAD_SHIFT is (PAGE_SHIFT << THREAD_SIZE_ORDER)
look incorrect. It should be (PAGE_SHIFT + THREAD_SIZE_ORDER) because
the following equation should hold:

Say PAGE_SHIFT == 13 (as the default value in ARC)
THREAD_SIZE_ORDER == 1 (as CONFIG_16KSTACKS=y)

THREAD_SIZE == (1 << THREAD_SHIFT)
            == (1 << (PAGE_SHIFT + THREAD_SIZE_ORDER))
	    == (1 << 14)
	    == 16KB

Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com>
---
 arch/arc/include/asm/thread_info.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arc/include/asm/thread_info.h b/arch/arc/include/asm/thread_info.h
index 6ba7fe417095..9f9dd021501c 100644
--- a/arch/arc/include/asm/thread_info.h
+++ b/arch/arc/include/asm/thread_info.h
@@ -22,7 +22,7 @@
 #endif
 
 #define THREAD_SIZE     (PAGE_SIZE << THREAD_SIZE_ORDER)
-#define THREAD_SHIFT	(PAGE_SHIFT << THREAD_SIZE_ORDER)
+#define THREAD_SHIFT	(PAGE_SHIFT + THREAD_SIZE_ORDER)
 
 #ifndef __ASSEMBLY__
 
-- 
2.34.1


_______________________________________________
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

  reply	other threads:[~2023-05-11 17:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 17:01 [PATCH 0/2] ARC: fix the THREAD_SHIFT definition Min-Hua Chen
2023-05-11 17:01 ` Min-Hua Chen [this message]
2023-05-11 17:01 ` [PATCH 2/2] ARC: rename 16KSTACKS to DEBUG_STACKS Min-Hua Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230511170139.343434-2-minhuadotchen@gmail.com \
    --to=minhuadotchen@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=vgupta@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).