From: "Bruno Prémont" <bonbons@linux-vserver.org>
To: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Bernie Thompson <bernie@plugable.com>
Subject: Re: [Patch, RFC] Make struct fb_info ref-counted with kref
Date: Tue, 21 Sep 2010 05:56:10 +0000 [thread overview]
Message-ID: <20100921075610.1c016c12@pluto.restena.lu> (raw)
In-Reply-To: <4C97E00B.6090103@gmx.de>
On Tue, 21 Sep 2010 00:28:27 Florian Tobias Schandinat <FlorianSchandinat@gmx.de> wrote:
> > Tracking if/how often framebuffer is opened as such is a separate thing (though
> > all users that have the framebuffer opened hold a reference to fb_info).
>
> That's what I said. So as long as refcount <= 1 it does not matter whether you
> just count on open/release or additionally on every framebuffer operation, just
> that the later produces more noise.
Hm, I don't count on every framebuffer operation... in most cases
fb_info is provided as function argument, in which case no further
counting is needed as the caller has a valid reference.
With my patch applied refcount for registered but unsed framebuffer was
2 (once for the driver, once for registered_fb entry) and went up to 3
when userspace opened framebuffer. fbcon's usage only incremented
refcount for very short timeframes when effectively using fb_info.
When starting with the FB minor I have to take a new reference.
(though I maybe should check if file's private data is set and use
that reference instead of looking up fb_info by minor as is currently
done)
For fbcon all the references are taken by FB minor (I wondered why
fbcon only remembers index into registered_fb aka minor instead of
fb_info itself)
> So I still don't see any advantage in counting users + uses.
> Please note that I do not object the idea of the patch itself, it's only that I
> have a different preference on what to count. I only want to express that your
> way is more complicated than what I would recommend.
I don't think I see how you would do the refcounting... would you just
drop the changes in fb_open() and fb_release()?
Could you describe your approach (with pseudo-code) or the differences
to mine?
Thanks,
Bruno
> But if you want to go on I do not object. As long as the end result works that's
> okay with me.
>
>
> Thanks
>
> Florian Tobias Schandinat
next prev parent reply other threads:[~2010-09-21 5:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-19 15:28 [Patch, RFC] Make struct fb_info ref-counted with kref Bruno Prémont
2010-09-19 16:47 ` Florian Tobias Schandinat
2010-09-19 17:02 ` Bruno Prémont
2010-09-20 19:05 ` Florian Tobias Schandinat
2010-09-20 19:32 ` Bruno Prémont
2010-09-20 20:08 ` Florian Tobias Schandinat
2010-09-20 20:36 ` Bruno Prémont
2010-09-20 22:28 ` Florian Tobias Schandinat
2010-09-21 5:56 ` Bruno Prémont [this message]
2010-09-21 6:39 ` Florian Tobias Schandinat
2010-09-21 7:02 ` Bruno Prémont
2010-09-22 17:31 ` James Simmons
2010-09-22 18:39 ` Bruno Prémont
2010-09-22 19:14 ` James Simmons
2010-09-22 19:35 ` Bruno Prémont
2010-09-20 19:34 ` Guennadi Liakhovetski
2010-09-20 20:14 ` Bruno Prémont
2010-09-20 20:27 ` Guennadi Liakhovetski
2010-09-21 10:44 ` Michel Dänzer
2010-09-20 8:27 ` Geert Uytterhoeven
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=20100921075610.1c016c12@pluto.restena.lu \
--to=bonbons@linux-vserver.org \
--cc=FlorianSchandinat@gmx.de \
--cc=bernie@plugable.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).