From: NeilBrown <neilb@suse.de>
To: Tejun Heo <tj@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Al Viro <viro@ZenIV.linux.org.uk>
Subject: [PATCH 0/2 V2] Allow access to sysfs attributes without mem allocations.
Date: Thu, 09 Oct 2014 10:57:06 +1100 [thread overview]
Message-ID: <20141008234119.19126.4182.stgit@notabene.brown> (raw)
Hi Tejun,
thanks for the review. This version incorporates your suggestions.
You are certainly right about there being issues deeper than just the
sysfs/kernfs level - I've been cleaning up the locking in md to avoid
the "reconfig_mutex" as much as possible. It is something that has
been at the back of my mind for a while, but this need has pushed it
to the fore-front. All the attributes that mdmon needs to touch will
soon only take a spinlock or nothing.
On the topic of inadvertently locking in semantics, I noticed that
prior to kernfs, sysfs would allocate a buffer on first read or
write, and continue to use that buffer. I could try to argue that I
was using those semantics, which have now changed ... though I wasn't
doing it consciously... Certainly this is a thorny issue.
As well as checking that ->seq_show isn't used with ->prealloc,
I've also made sure that sysfs_kf_read() doesn't call the attribute
->show() function unless it is certain it has a preallocated (and
hence >= PAGE_SIZE) buffer.
Thanks,
NeilBrown
---
NeilBrown (2):
sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
sysfs/kernfs: make read requests on pre-alloc files use the buffer.
fs/kernfs/file.c | 70 ++++++++++++++++++++++++++++++++----------------
fs/sysfs/file.c | 53 +++++++++++++++++++++++++++++++-----
include/linux/kernfs.h | 2 +
include/linux/sysfs.h | 9 ++++++
4 files changed, 103 insertions(+), 31 deletions(-)
--
Signature
next reply other threads:[~2014-10-08 23:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-08 23:57 NeilBrown [this message]
2014-10-08 23:57 ` [PATCH 2/2] sysfs/kernfs: make read requests on pre-alloc files use the buffer NeilBrown
2014-10-09 13:52 ` Tejun Heo
2014-10-08 23:57 ` [PATCH 1/2] sysfs/kernfs: allow attributes to request write buffer be pre-allocated NeilBrown
2014-10-09 13:32 ` Tejun Heo
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=20141008234119.19126.4182.stgit@notabene.brown \
--to=neilb@suse.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/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