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 v13 06/14] xtensa: remove the get_order() implementation
Date: Thu, 8 Aug 2024 20:37:06 +0800	[thread overview]
Message-ID: <20240808123714.462740-7-linyunsheng@huawei.com> (raw)
In-Reply-To: <20240808123714.462740-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 in next patch.

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.33.0


  parent reply	other threads:[~2024-08-08 12:43 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08 12:37 [PATCH net-next v13 00/14] Replace page_frag with page_frag_cache for sk_page_frag() Yunsheng Lin
2024-08-08 12:37 ` [PATCH net-next v13 01/14] mm: page_frag: add a test module for page_frag Yunsheng Lin
2024-08-09 11:08   ` Muhammad Usama Anjum
2024-08-09 12:29     ` Yunsheng Lin
2024-08-08 12:37 ` [PATCH net-next v13 02/14] mm: move the page fragment allocator from page_alloc into its own file Yunsheng Lin
2024-08-14 15:33   ` Alexander H Duyck
2024-08-14 20:22   ` Andrew Morton
2024-08-08 12:37 ` [PATCH net-next v13 03/14] mm: page_frag: use initial zero offset for page_frag_alloc_align() Yunsheng Lin
2024-08-08 12:37 ` [PATCH net-next v13 04/14] mm: page_frag: add '_va' suffix to page_frag API Yunsheng Lin
2024-08-14 15:49   ` Alexander H Duyck
2024-08-15  2:59     ` Yunsheng Lin
2024-08-15 15:00       ` Alexander Duyck
2024-08-16 11:55         ` Yunsheng Lin
2024-08-19 15:54           ` Alexander Duyck
2024-08-20 13:07             ` Yunsheng Lin
2024-08-20 16:02               ` Alexander Duyck
2024-08-21 12:30                 ` Yunsheng Lin
2024-08-08 12:37 ` [PATCH net-next v13 05/14] mm: page_frag: avoid caller accessing 'page_frag_cache' directly Yunsheng Lin
2024-08-08 12:37 ` Yunsheng Lin [this message]
2024-08-08 12:37 ` [PATCH net-next v13 07/14] mm: page_frag: reuse existing space for 'size' and 'pfmemalloc' Yunsheng Lin
2024-08-14 16:13   ` Alexander H Duyck
2024-08-15  3:10     ` Yunsheng Lin
2024-08-15 15:03       ` Alexander Duyck
2024-08-16 11:55         ` Yunsheng Lin
2024-08-19 16:00           ` Alexander Duyck
2024-08-08 12:37 ` [PATCH net-next v13 08/14] mm: page_frag: some minor refactoring before adding new API Yunsheng Lin
2024-08-14 17:54   ` Alexander H Duyck
2024-08-15  3:04     ` Yunsheng Lin
2024-08-15 15:09       ` Alexander Duyck
2024-08-16 11:58         ` Yunsheng Lin
2024-08-08 12:37 ` [PATCH net-next v13 09/14] mm: page_frag: use __alloc_pages() to replace alloc_pages_node() Yunsheng Lin
2024-08-08 12:37 ` [PATCH net-next v13 10/14] net: rename skb_copy_to_page_nocache() helper Yunsheng Lin
2024-08-08 12:37 ` [PATCH net-next v13 11/14] mm: page_frag: introduce prepare/probe/commit API Yunsheng Lin
2024-08-14 21:00   ` Alexander H Duyck
2024-08-15  3:05     ` Yunsheng Lin
2024-08-15 15:25       ` Alexander Duyck
2024-08-16 12:01         ` Yunsheng Lin
2024-08-19 15:52           ` Alexander Duyck
2024-08-20 13:08             ` Yunsheng Lin
2024-08-08 12:37 ` [PATCH net-next v13 12/14] net: replace page_frag with page_frag_cache Yunsheng Lin
2024-08-14 22:01   ` Alexander H Duyck
2024-08-18 14:17     ` Yunsheng Lin
2024-08-08 12:37 ` [PATCH net-next v13 13/14] mm: page_frag: update documentation for page_frag Yunsheng Lin
2024-08-08 12:37 ` [PATCH net-next v13 14/14] mm: page_frag: add an entry in MAINTAINERS " Yunsheng Lin
2024-08-13 11:30 ` [PATCH net-next v13 00/14] Replace page_frag with page_frag_cache for sk_page_frag() Yunsheng Lin
2024-08-13 15:11   ` Alexander Duyck
2024-08-14 11:55     ` 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=20240808123714.462740-7-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®