Re: Kernel Oops on alpha with kernel version >=6.9.x

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 19, 2024 at 11:38:09PM +0100, Magnus Lindholm wrote:
> > In the past, there have been compiler optimizations that would use a large
> > store to update a smaller variable, and then do small stores to fix up the
> > clobbered areas.  These were all supposed to have been removed for C11.
> > Might some linger in Alpha's compilers?
> 
> 
> Hi again,
> 
> Making just these (see below) one-liner changes to tree_exp.h and
> smp.c respectively, lets me boot kernel 6.12.5 on alpha without
> passing any special rcu parameters to the kernel and it also lets me
> load/unload my scsi kernel module. Is the alignment of structs just
> giving gcc more room to clobber the stack without actually hitting
> anything important or is it relevant for how kernel threads access
> structs on weak memory-model architectures?

This looks like the aforementioned bug in Alpha's compilers, namely
failing to comply with C11's restrictions against compiler-induced
data races.  I can't say that I am at all excited about accepting these
changes because they increase stack size.

The best thing would of course be to fix the compiler.  If that cannot
be done, why not just carry these patches?

							Thanx, Paul

> /Magnus
> 
> +++ kernel/rcu/tree_exp.h 2024-12-19 18:55:59.091893649 +0100
> @@ -940,10 +939,10 @@
>  void synchronize_rcu_expedited(void)
>  {
>   unsigned long flags;
> - struct rcu_exp_work rew;
> + struct ____cacheline_aligned_in_smp rcu_exp_work rew;
>   struct rcu_node *rnp;
>   unsigned long s;
> 
> 
> +++ kernel/smp.c        2024-12-19 19:01:20.592819628 +0100
> @@ -631,7 +631,7 @@
> int smp_call_function_single(int cpu, smp_call_func_t func, void *info,
>                              int wait)
>  {
>         call_single_data_t *csd;
> -       call_single_data_t csd_stack = {
> +       struct ____cacheline_aligned_in_smp __call_single_data csd_stack = {
>                 .node = { .u_flags = CSD_FLAG_LOCK | CSD_TYPE_SYNC, },
>         };
>         int this_cpu;




[Index of Archives]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux