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] [thread-next>] [day] [month] [year] [list]
Message-ID: <27bcb12e-453c-449e-e4f9-93ac7a3dcaa2@oracle.com>
Date:   Fri, 3 Mar 2023 07:32:00 +1100
From:   Imran Khan <imran.f.khan@...cle.com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     tj@...nel.org, gregkh@...uxfoundation.org, viro@...iv.linux.org.uk,
        linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        joe.jin@...cle.com
Subject: Re: [PATCH 1/3] kernfs: Introduce separate rwsem to protect inode
 attributes.

Hello Matthew,
Thanks for reviewing this,

On 3/3/2023 3:14 am, Matthew Wilcox wrote:
> On Thu, Mar 02, 2023 at 03:32:01PM +1100, Imran Khan wrote:
>> +++ b/fs/kernfs/kernfs-internal.h
>> @@ -47,6 +47,7 @@ struct kernfs_root {
>>  
>>  	wait_queue_head_t	deactivate_waitq;
>>  	struct rw_semaphore	kernfs_rwsem;
>> +	struct rw_semaphore	kernfs_iattr_rwsem;
>>  };
>>  
>>  /* +1 to avoid triggering overflow warning when negating it */
> 
> Can you explain why we want one iattr rwsem per kernfs_root instead of
> one rwsem per kernfs_node?

Having an iattr rwsem per kernfs_node would increase memory usage due to
kobjects. I had tried per kernfs_node approach for a couple of other global
locks earlier [1], but that approach was not encouraged because it would impact
ability to use sysfs on low memory (especially 32 bit) systems. This was the
reason for keeping iattr rwsem in kernfs_root.

Thanks,
Imran

[1]: https://lore.kernel.org/all/YdLH6qQNxa11YmRO@kroah.com/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ