2022-05-19 22:25:58

by Imran Khan

[permalink] [raw]
Subject: [PATCH v4 0/4] kernfs: make ->attr.open RCU protected.

The patches in this version of the patch set are as follows:

PATCH-1: Make kernfs_open_node->attr.open RCU protected.

PATCH-2: Change kernfs_notify_list to llist.

PATCH-3: Introduce interface to access kernfs_open_file_mutex.

PATCH-4: Replace global kernfs_open_file_mutex with hashed mutexes.

Changes since v3:
- Rebase on tag next-20220518
- Rename RCU access related helpers and update their description
- Address errors reported by kernel test robot
- Include Acked-by tags from Tejun for the acked patches (PATCH-2,3,4)

Changes since v2:
- Rebase on tag next-20220510
- Remove PATCH-1 of v2 because it is present in tag next-20220510
- Include Acked-by tags from Tejun for the acked patches (PATCH-2 and PATCH-3)


Cover letter for v2:
--------------------------------------------------------------------------

I have not yet received any feedback about v1 of this patchset [2] but
in the meantime an old version of first patch from [3] has been integrated in
linux-next. Functionally first patch in both [2] and [3] are identical.
It's just that [2] has renamed one of the functions to better reflect the fact
that we are no longer using reference counting for kernfs_open_node.

In this version, I have just modified first patch of v1 so that we use the
modified function name as done in [2] and avoid those parts that are already
present in linux-next now. The remaining 4 patches (PATCH-2 to PATCH-5) are
identical in both v1 and v2 albeit v2 has been rebased on tag next-20220503.

Changes since v1:
- Rebase on tag next-20220503

[2]: https://lore.kernel.org/lkml/[email protected]/
[3]: https://lore.kernel.org/lkml/[email protected]/

Original cover letter
-------------------------------------------------------

This patchset contains subset of patches (after addressing review comments)
discussed at [1]. Since [1] is replacing multiple global locks and since
each of these locks can be removed independently, it was decided that we
should make these changes in parts i.e first get one set of optimizations
integrated and then work on top of those further.

The patches in this change set introduce following changes:

PATCH-1: Remove reference counting for kernfs_open_node.

PATCH-2: Make kernfs_open_node->attr.open RCU protected.

PATCH-3: Change kernfs_notify_list to llist.

PATCH-4: Introduce interface to access kernfs_open_file_mutex.

PATCH-5: Replace global kernfs_open_file_mutex with hashed mutexes.

[1] https://lore.kernel.org/lkml/[email protected]/

----------------------------------------------------------------

Imran Khan (4):
kernfs: make ->attr.open RCU protected.
kernfs: Change kernfs_notify_list to llist.
kernfs: Introduce interface to access global kernfs_open_file_mutex.
kernfs: Replace global kernfs_open_file_mutex with hashed mutexes.

fs/kernfs/file.c | 270 +++++++++++++++++++++++-------------
fs/kernfs/kernfs-internal.h | 4 +
fs/kernfs/mount.c | 19 +++
include/linux/kernfs.h | 61 +++++++-
4 files changed, 258 insertions(+), 96 deletions(-)


base-commit: 736ee37e2e8eed7fe48d0a37ee5a709514d478b3
--
2.30.2



2022-05-26 11:05:18

by Imran Khan

[permalink] [raw]
Subject: Re: [PATCH v4 0/4] kernfs: make ->attr.open RCU protected.

Hello Tejun,

On 19/5/22 5:26 pm, Imran Khan wrote:
> The patches in this version of the patch set are as follows:
>
> PATCH-1: Make kernfs_open_node->attr.open RCU protected.
>
> PATCH-2: Change kernfs_notify_list to llist.
>
> PATCH-3: Introduce interface to access kernfs_open_file_mutex.
>
> PATCH-4: Replace global kernfs_open_file_mutex with hashed mutexes.
>
> Changes since v3:
> - Rebase on tag next-20220518
> - Rename RCU access related helpers and update their description
> - Address errors reported by kernel test robot
> - Include Acked-by tags from Tejun for the acked patches (PATCH-2,3,4)
>

I have updated the description of RCU access helpers and have addressed CI
errors as well. Could you please check this and let me know if it looks okay.
Patches 2,3 and 4 have already been acked in earlier version of this this patch
set and they have not changed in this version. It is just Patch 1 that needs
further review. Thanks again for your help.

-- Imran