Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Alexander Grund <theflamefire89@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: stable@vger.kernel.org
Subject: Re: [PATCH 4.9 0/1] selinux: drop super_block backpointer from superblock_security_struct
Date: Thu, 11 Aug 2022 13:04:35 +0200	[thread overview]
Message-ID: <22d70809-5db1-8258-b695-bc6aaa9ab9bf@gmail.com> (raw)
In-Reply-To: <YvTYGJh2JQR4vOVZ@kroah.com>

On 11.08.22 12:21, Greg KH wrote:
> On Thu, Aug 11, 2022 at 11:46:09AM +0200, Alexander Grund wrote:
>> I mean this patch removes a superflous pointer of the superblock struct
>> making the kernel use less memory.
> 
> Also, how much measurable memory does this save?  You did not quantify
> it.

It saves one pointer, i.e. usually 8 Byte, per superblock when using SELinux.

I don't know how many of those superblocks will be allocated in total on usual systems
as I'm not familiar with the details of the filesystems.
However following one callchain leads to

> /*
> * Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that
> * will never be mountable)
> */
> struct dentry *mount_pseudo_xattr(struct file_system_type *fs_type, char *name,

So it seems one superblock even for each pseudo-fs of which there can be many.

A quick experiment [1] on my phone shows about 300 superblocks allocated which means
that the patch saves a bit over 2kB of memory.
So not that much on usual systems but could be much for some embedded systems.

I hope that helps,
Alex

[1] For the experiment I added a debug counter to `superblock_alloc_security`

  reply	other threads:[~2022-08-11 11:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-08 11:59 [PATCH 4.9 0/1] selinux: drop super_block backpointer from superblock_security_struct Alexander Grund
2022-08-08 11:59 ` [PATCH 4.9 1/1] " Alexander Grund
2022-08-08 13:28 ` [PATCH 4.9 0/1] " Greg KH
2022-08-11  9:46   ` Alexander Grund
2022-08-11 10:20     ` Greg KH
2022-08-11 10:21     ` Greg KH
2022-08-11 11:04       ` Alexander Grund [this message]
2022-08-11 13:46         ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22d70809-5db1-8258-b695-bc6aaa9ab9bf@gmail.com \
    --to=theflamefire89@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox