lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAB=BE-S6S4m-uk9r=eQdM1foi+3HpZrEh0WYD5S9Q-aaP19G9g@mail.gmail.com>
Date: Tue, 6 May 2025 16:02:47 -0700
From: Sandeep Dhavale <dhavale@...gle.com>
To: Gao Xiang <hsiangkao@...ux.alibaba.com>
Cc: linux-erofs@...ts.ozlabs.org, Gao Xiang <xiang@...nel.org>, 
	Chao Yu <chao@...nel.org>, Yue Hu <zbestahu@...il.com>, 
	Jeffle Xu <jefflexu@...ux.alibaba.com>, kernel-team@...roid.com, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5] erofs: lazily initialize per-CPU workers and CPU
 hotplug hooks

Hi Gao,
> >   #ifdef CONFIG_EROFS_FS_PCPU_KTHREAD
> >   static struct kthread_worker __rcu **z_erofs_pcpu_workers;
> > +static atomic_t erofs_percpu_workers_initialized = ATOMIC_INIT(0);
> > +static int erofs_cpu_hotplug_init(void);
> > +static void erofs_cpu_hotplug_destroy(void);
>
> We could move downwards to avoid those forward declarations;
>
Sure, I ended up moving the CONFIG_HOTPLUG_CPU block inside
CONFIG_EROFS_FS_PCPU_KTHREAD. That gets rid of forward declaration and
also much readable.
> >
> >   static void erofs_destroy_percpu_workers(void)
> >   {
> > @@ -336,9 +339,45 @@ static int erofs_init_percpu_workers(void)
> >       }
> >       return 0;
> >   }
> > +
> > +static int z_erofs_init_pcpu_workers(void)
>
> How about passing in `struct super_block *` here?
> Since print messages are introduced, it's much better to
> know which instance caused the error/info.
>
Sounds good. Log message now looks like this

[    8.724634] erofs (device loop0): initialized per-cpu workers successfully.
[    8.726133] erofs (device loop0): mounted with root inode @ nid 40.

Thanks for the review.
v6 addressing this is available at:
https://lore.kernel.org/linux-erofs/20250506225743.308517-1-dhavale@google.com/

Thanks,
Sandeep.

> > +{
> > +     int err;
> > +
> > +     if (atomic_xchg(&erofs_percpu_workers_initialized, 1))
> > +             return 0;
> > +
> > +     err = erofs_init_percpu_workers();
> > +     if (err) {
> > +             erofs_err(NULL, "per-cpu workers: failed to allocate.");
> > +             goto err_init_percpu_workers;
> > +     }
> > +
> > +     err = erofs_cpu_hotplug_init();
> > +     if (err < 0) {
> > +             erofs_err(NULL, "per-cpu workers: failed CPU hotplug init.");
> > +             goto err_cpuhp_init;
> > +     }
> > +     erofs_info(NULL, "initialized per-cpu workers successfully.");
>
>
> Otherwise it looks good to me know.
>
> Thanks,
> Gao Xiang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ