[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.02.1205221553400.3231@ionos>
Date: Tue, 22 May 2012 17:26:38 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Steven Rostedt <rostedt@...dmis.org>
cc: LKML <linux-kernel@...r.kernel.org>,
RT <linux-rt-users@...r.kernel.org>,
Clark Williams <williams@...hat.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [RFC][PATCH RT] rwsem_rt: Another (more sane) approach to mulit
reader rt locks
On Tue, 15 May 2012, Steven Rostedt wrote:
> +struct rw_semaphore {
> + int initialized;
> + struct __rw_semaphore lock[NR_CPUS];
So that will blow up every rw_semaphore user by
NR_CPUS * sizeof(struct __rw_semaphore)
With lockdep off thats: NR_CPUS * 48
With lockdep on thats: NR_CPUS * 128 + NR_CPUS * 8 (__key)
So for NR_CPUS=64 that's 3072 or 8704 Bytes.
That'll make e.g. XFS happy. xfs_inode has two rw_sems.
sizeof(xfs_inode) in mainline is: 856 bytes
sizeof(xfs_inode) on RT is: 1028 bytes
But with your change it would goto (NR_CPUS = 64):
1028 - 96 + 2 * 3072 = 7076 bytes
That's almost an order of magnitude!
NFS has an rwsem in the inode as well, and ext4 has two.
So we trade massive memory waste for how much performance?
We really need numbers for various scenarios. There are applications
which are pretty mmap heavy and it would really surprise me when
taking NR_CPUS locks in one go is not going to cause a massive
overhead.
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists