mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Lorenzo Stoakes <ljs@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	pfalcato@suse.de, vbabka@kernel.org,
	Marco Elver <elver@google.com>,
	Brendan Jackman <jackmanb@google.com>,
	Suren Baghdasaryan <surenb@google.com>,
	linux-kernel@vger.kernel.org,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: Duplicate headers in tools/testing/shared directory diverged - rcupdate.h
Date: Wed, 15 Apr 2026 11:00:11 -0600	[thread overview]
Message-ID: <52ced596-baee-451d-8696-3ae0e8054e19@linuxfoundation.org> (raw)
In-Reply-To: <ad_A5rPVxNMcJ0tF@lucifer>

On 4/15/26 10:50, Lorenzo Stoakes wrote:
> On Wed, Apr 15, 2026 at 10:39:05AM -0600, Shuah Khan wrote:
>> All,
>>
>> I am sending this email to you all because you touched tools/testing/shared
>> and its sub directories and show up in
> 
> We need to add these to somewhere in MAINTAINERS...
> 
>>
>> get_maintainer.pl -f tools/testing/shared/ output
>>
>> rbtree compile failed as it couldn't find urcu.h
> 
> Presumably liburcu is not installed.
> 
>>
>> cc -I../shared -I. -I../../include -I../../arch/x86/include -I../../../lib -g -Og -Wall -D_LGPL_SOURCE -fsanitize=address -fsanitize=undefined    -c -o rbtree_test.o rbtree_test.c
>> In file included from ../shared/shared.h:11,
>>                   from rbtree_test.c:9:
>> ../shared/linux/rcupdate.h:5:10: fatal error: urcu.h: No such file or directory
>>      5 | #include <urcu.h>
>>        |          ^~~~~~~~
>> compilation terminated.
>>
>> This sent me down the path to look at the duplicate headers in tools/testing/shared
>> especially rcupdate.h which is under tools/testing/shared/linux
>>
>> It appears this file is an exact copy of include/linux/rcupdate.h and now it
> 
> $ wc -l tools/testing/shared/linux/rcupdate.h
> 12 tools/testing/shared/linux/rcupdate.h
> $ wc -l include/linux/rcupdate.h
> 1196 include/linux/rcupdate.h
> 
> Umm, no?

My bad - I looked at diff wrong. You can ignore the duplicate headers
stuff.

> 
>> diverged. Why do we have these duplicate headers here in this shared
>> directory - it appears they are out of date and lead to maintenance problems.
> 
> Because they're not duplicates of one another? One is a wrapper around urcu,
> your problem is you don't have that library installed.

It would have been nice to find a different name for this header and also
have some information about its purpose? It says nothing.


/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _RCUPDATE_H
#define _RCUPDATE_H

#include <urcu.h>

#define rcu_dereference_raw(p) rcu_dereference(p)
#define rcu_dereference_protected(p, cond) rcu_dereference(p)
#define rcu_dereference_check(p, cond) rcu_dereference(p)
#define RCU_INIT_POINTER(p, v)  do { (p) = (v); } while (0)

#endif

That solved one problem - still seeing others:

cc -I../shared -I. -I../../include -I../../arch/x86/include -I../../../lib -g -Og -Wall -D_LGPL_SOURCE -fsanitize=address -fsanitize=undefined    -c -o rbtree_test.o rbtree_test.c
In file included from rbtree_test.c:11:
../../../lib/rbtree_test.c: In function ‘rbtree_test_init’:
../../../lib/rbtree_test.c:402:17: error: implicit declaration of function ‘kmalloc_objs’; did you mean ‘kzalloc_obj’? [-Wimplicit-function-declaration]
   402 |         nodes = kmalloc_objs(*nodes, nnodes);
       |                 ^~~~~~~~~~~~
       |                 kzalloc_obj
../../../lib/rbtree_test.c:402:15: error: assignment to ‘struct test_node *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
   402 |         nodes = kmalloc_objs(*nodes, nnodes);
       |               ^

thanks,
-- Shuah

      reply	other threads:[~2026-04-15 17:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15 16:39 Shuah Khan
2026-04-15 16:49 ` Marco Elver
2026-04-15 16:50 ` Lorenzo Stoakes
2026-04-15 17:00   ` Shuah Khan [this message]

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=52ced596-baee-451d-8696-3ae0e8054e19@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=elver@google.com \
    --cc=jackmanb@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ljs@kernel.org \
    --cc=pfalcato@suse.de \
    --cc=surenb@google.com \
    --cc=vbabka@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

all inboxes | Powered by JetHome®