All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: "Adam C. Emerson" <aemerson@redhat.com>, John Spray <jspray@redhat.com>
Cc: The Sacred Order of the Squid Cybernetic <ceph-devel@vger.kernel.org>
Subject: Re: should CephContext be a singleton?
Date: Thu, 14 Sep 2017 09:28:11 -0400	[thread overview]
Message-ID: <1505395691.4870.22.camel@redhat.com> (raw)
In-Reply-To: <20170913153021.GB31125@ultraspiritum.eng.arb.redhat.com>

On Wed, 2017-09-13 at 11:30 -0400, Adam C. Emerson wrote:
> On 13/09/2017, John Spray wrote:
> [snip]
> > The separation between process global stuff and per-cluster stuff
> > still seems entirely sensible, I don't know how much progress was made
> > with that for the RGW/RBD bits that have cluster-spanning daemons?
> 
> As I understand it, people agreed on getting rid of g_ceph_context but
> not on separation, but if people like separation....
> 
> But! Either way, the other advantage of getting rid of g_ceph_context
> is that it makes embedding potentially multiple daemons in processes
> and clears up other librarification issues. (For example, if we ever
> wanted to try client-side erasure coding, the g_ceph_context in the
> ErasureCode library might be a problem.)
> 
> Sage also worried about logging and the problem of marking messages
> from multiple OSDs in a single process and making sure they went to
> the appropriate files and so on. I had an idea for keeping the
> per-process context and logging thread-local and simulating dynamic
> scoping on top of it to address the logging problem, but that was
> thought to be too complicated and people liked just passing it around
> instead.
> 
> 
> > I was wondering about this the other day, does std::mutex give us the
> > cycle detection some other way?  lockdep is a seriously useful thing.
> 
> Well! If you want lockdep, there's common/mutex_debug.h which plugs
> into lockdep. You could insert it anywhere you wanted to use lockdep
> or have more run-time checking.
> 

Fair enough, and thanks for all the input. At this point, I've pretty
much determined that the main problem in that tracker bug is with
lockdep.

I'm going to opt for smaller, more targeted surgery that should keep
things working more or less as they are, but close the races that can
occur when the cct is unregistered from lockdep while other threads are
concurrently manipulating mutexes. That has the advantage of being
relatively easy to backport too, I think.

I should have a PR up in a day or two, once I do some more testing with
the series.

Thanks!
-- 
Jeff Layton <jlayton@redhat.com>

  reply	other threads:[~2017-09-14 13:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-13 14:58 should CephContext be a singleton? Jeff Layton
2017-09-13 15:09 ` Adam C. Emerson
2017-09-13 15:16   ` John Spray
2017-09-13 15:30     ` Adam C. Emerson
2017-09-14 13:28       ` Jeff Layton [this message]
2017-09-13 15:22   ` Jeff Layton
2017-09-13 15:16 ` Sage Weil

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=1505395691.4870.22.camel@redhat.com \
    --to=jlayton@redhat.com \
    --cc=aemerson@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=jspray@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.