mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yunsheng Lin <linyunsheng@huawei.com>
To: <davem@davemloft.net>, <kuba@kernel.org>, <pabeni@redhat.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Yunsheng Lin <linyunsheng@huawei.com>,
	Alexander Duyck <alexander.duyck@gmail.com>,
	Max Filippov <jcmvbkbc@gmail.com>,
	Chris Zankel <chris@zankel.net>
Subject: [PATCH net-next v6 02/15] xtensa: remove the get_order() implementation
Date: Wed, 5 Jun 2024 21:32:52 +0800	[thread overview]
Message-ID: <20240605133306.11272-3-linyunsheng@huawei.com> (raw)
In-Reply-To: <20240605133306.11272-1-linyunsheng@huawei.com>

As the get_order() implemented by xtensa supporting 'nsau'
instruction seems be the same as the generic implementation
in include/asm-generic/getorder.h when size is not a constant
value as the generic implementation calling the fls*() is also
utilizing the 'nsau' instruction for xtensa.

So remove the get_order() implemented by xtensa, as using the
generic implementation may enable the compiler to do the
computing when size is a constant value instead of runtime
computing and enable the using of get_order() in BUILD_BUG_ON()
macro.

CC: Alexander Duyck <alexander.duyck@gmail.com>
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/include/asm/page.h | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/arch/xtensa/include/asm/page.h b/arch/xtensa/include/asm/page.h
index 4db56ef052d2..8665d57991dd 100644
--- a/arch/xtensa/include/asm/page.h
+++ b/arch/xtensa/include/asm/page.h
@@ -109,26 +109,8 @@ typedef struct page *pgtable_t;
 #define __pgd(x)	((pgd_t) { (x) } )
 #define __pgprot(x)	((pgprot_t) { (x) } )
 
-/*
- * Pure 2^n version of get_order
- * Use 'nsau' instructions if supported by the processor or the generic version.
- */
-
-#if XCHAL_HAVE_NSA
-
-static inline __attribute_const__ int get_order(unsigned long size)
-{
-	int lz;
-	asm ("nsau %0, %1" : "=r" (lz) : "r" ((size - 1) >> PAGE_SHIFT));
-	return 32 - lz;
-}
-
-#else
-
 # include <asm-generic/getorder.h>
 
-#endif
-
 struct page;
 struct vm_area_struct;
 extern void clear_page(void *page);
-- 
2.30.0


  parent reply	other threads:[~2024-06-05 13:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-05 13:32 [PATCH net-next v6 00/15] First try to replace page_frag with page_frag_cache Yunsheng Lin
2024-06-05 13:32 ` [PATCH net-next v6 01/15] mm: page_frag: add a test module for page_frag Yunsheng Lin
2024-06-05 13:32 ` Yunsheng Lin [this message]
2024-06-05 13:32 ` [PATCH net-next v6 03/15] mm: page_frag: use free_unref_page() to free page fragment Yunsheng Lin
2024-06-05 13:32 ` [PATCH net-next v6 04/15] mm: move the page fragment allocator from page_alloc into its own file Yunsheng Lin
2024-06-05 13:32 ` [PATCH net-next v6 05/15] mm: page_frag: use initial zero offset for page_frag_alloc_align() Yunsheng Lin
2024-06-05 13:32 ` [PATCH net-next v6 06/15] mm: page_frag: add '_va' suffix to page_frag API Yunsheng Lin
2024-06-05 13:32 ` [PATCH net-next v6 07/15] mm: page_frag: avoid caller accessing 'page_frag_cache' directly Yunsheng Lin
2024-06-05 13:32 ` [PATCH net-next v6 08/15] mm: page_frag: reuse existing space for 'size' and 'pfmemalloc' Yunsheng Lin
2024-06-05 13:32 ` [PATCH net-next v6 09/15] mm: page_frag: some minor refactoring before adding new API Yunsheng Lin
2024-06-05 13:33 ` [PATCH net-next v6 10/15] mm: page_frag: use __alloc_pages() to replace alloc_pages_node() Yunsheng Lin
2024-06-05 13:33 ` [PATCH net-next v6 11/15] net: introduce the skb_copy_to_va_nocache() helper Yunsheng Lin
2024-06-05 13:33 ` [PATCH net-next v6 12/15] mm: page_frag: introduce prepare/probe/commit API Yunsheng Lin
2024-06-05 13:33 ` [PATCH net-next v6 13/15] net: replace page_frag with page_frag_cache Yunsheng Lin
2024-06-05 13:33 ` [PATCH net-next v6 14/15] mm: page_frag: update documentation for page_frag Yunsheng Lin
2024-06-06 16:37   ` Jakub Kicinski
2024-06-05 13:33 ` [PATCH net-next v6 15/15] mm: page_frag: add a entry in MAINTAINERS " Yunsheng Lin

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=20240605133306.11272-3-linyunsheng@huawei.com \
    --to=linyunsheng@huawei.com \
    --cc=alexander.duyck@gmail.com \
    --cc=chris@zankel.net \
    --cc=davem@davemloft.net \
    --cc=jcmvbkbc@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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

all inboxes | Powered by JetHome®