From: Rusty Russell <rusty@rustcorp.com.au>
To: Amit Shah <amit.shah@redhat.com>
Cc: borntraeger@de.ibm.com, hch@lst.de,
Virtualization List <virtualization@lists.linux-foundation.org>
Subject: Re: virtio: console: Barrier needed before dropping early_put_chars?
Date: Wed, 24 Feb 2010 11:37:08 +1030 [thread overview]
Message-ID: <201002241137.08243.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20100223171022.GB32564@amit-x200.redhat.com>
On Wed, 24 Feb 2010 03:40:22 am Amit Shah wrote:
> Hey Rusty, Christian,
>
> Christoph Hellwig asked why we don't need a barrier before this code in
> virtcons_probe():
>
> > + /* Start using the new console output. */
> > + early_put_chars = NULL;
> > return 0;
>
> Since only s390 uses early_put_chars so far, you'd know why it's not
> needed / why we're safe.
He's right, it's sloppy.
In practice the compiler checks for NULL and reuses the pointer, and we
have no problem if this is used a couple of times after the real console is
live.
The Right Way to do this is a lock in put_chars() and around this assignment.
But do we really want to bother?
Cheers,
Rusty.
--
Away travelling 25Feb-26Mar (6 .de + 1 .pl + 17 .lt + 2 .sg)
prev parent reply other threads:[~2010-02-24 1:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-23 17:10 virtio: console: Barrier needed before dropping early_put_chars? Amit Shah
2010-02-23 22:07 ` Christian Borntraeger
2010-02-24 1:07 ` Rusty Russell [this message]
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=201002241137.08243.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=amit.shah@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=hch@lst.de \
--cc=virtualization@lists.linux-foundation.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).