linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [GIT PULL] Driver core fixes for 5.7-rc7 - take 2
Date: Mon, 25 May 2020 09:40:20 +0200	[thread overview]
Message-ID: <20200525074020.GC261205@kroah.com> (raw)
In-Reply-To: <CAHk-=wh4bZdCkhng3EsJCDhHLxHT6x4S66v5JQvusihVfYrc5Q@mail.gmail.com>

On Sun, May 24, 2020 at 10:05:28AM -0700, Linus Torvalds wrote:
> On Sun, May 24, 2020 at 8:00 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Sat, May 23, 2020 at 11:14:28AM -0700, Linus Torvalds wrote:
> > >
> > > Hmm. That original patch looks obviously buggy: in kobject_cleanup()
> > > it would end up doing "kobject_put(parent)" regardless of whether it
> > > had actually done __kobject_del() or not.
> > >
> > > That _could_ have been intentional, but considering the commit
> > > message, it clearly wasn't in this case.  It might be worth re-trying
> > > to the commit, just with that fixed.
> >
> > Turns out that wasn't the real problem here, the culprit is the
> > lib/test_printf.c code trying to tear down a kobject tree from the
> > parent down to the children (i.e. in the backwards order).
> 
> Note that the "obviously buggy or at least not documented" behavior of
> that commit 4ef12f719802 ("kobject: Make sure the parent does not get
> released before its children") that got reverted is true regardless.
> 
> Should the parent be released unconditionally (like that commit does),
> or should it be released only when kobject_del() was called when it
> had "state_in_sysfs" set?
> 
> Even if the problem Guenter reported was due to something else, that
> other change is a rather fundamental change and should at least be
> mentioned by the commit log.
> 
> It's entirely possible that the parent dropping should always be done,
> but the way it was done in that reverted commit it looked kind of
> accidental.

I'll revisit this and try to figure it out, but I think what we have
today is still correct.  The only "problem" that people were having with
the original code is the kobject_uevent() path walk when a parent was
gone before the child.  I've sent a patch to solve that problem, so we
"should" be ok.

Unfortunatly, it turns out that the owner of the kobject in question was
assuming that it could always reach the parent when things were being
cleaned up, but it was tearing things down in the backwards order.  So
even if I did move the logic around "correctly" in this patch, it still
died a horrible death (and there was other under-run errors reported as
well by other subsystems.)

So again, I think what we have today is ok.  But I'll beat on it for a
while this week to ensure that.  Time to start using the kunit test
framework for kobjects it seems :)

> > What is really odd now, is that 'git log lib/kobject.c' does not show
> > the change/revert at all.  Is that because there was a revert?  Or is it
> > a git config option/default somewhere that prevents that from showing
> > up?
> 
> No, it's fundamentally how git works.
> 
> Remember: git does _not_ track "changes".
> 
> Any SCM that tracks changes to a file is fundamentally broken, for
> fundamental reasons. It mostly boils down to "what happens when the
> source of the change the same file in two branches is different".
> Think "rename to X" and "create X", and remember all the problems SVN
> has when that happens.
> 
> So no, git never _ever_ tracks "what changed". Instead, git
> fundamentally tracks "what is the state". The "change" is not
> fundamental, it's something that gets computed afterwards when you
> have a "before and after" state.

Doh, ok, that makes more sense.  It's just that a apply/revert sequence
does not happen a lot that I happen to notice this when digging through
the logs for fixes.

> If you want it all, use "git log --full-history", but then you will
> _really_ get the full history and a lot of pointless noise. And even
> then, things like "blame" won't waste time on following merges that
> made no difference in the end.

I'll use --full-history for now on when trying to dig up stable changes,
as that should help.  But ugh, you are right, there is a lot more noise
in there, loads of merge commits that shouldn't matter.  Will add
--no-merges to the line as well, and that helps out.

thanks,

greg k-h

  parent reply	other threads:[~2020-05-25  7:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-23 13:17 [GIT PULL] Driver core fixes for 5.7-rc7 Greg KH
2020-05-23 14:05 ` Greg KH
2020-05-23 15:29 ` [GIT PULL] Driver core fixes for 5.7-rc7 - take 2 Greg KH
2020-05-23 18:14   ` Linus Torvalds
2020-05-24 15:00     ` Greg KH
2020-05-24 15:38       ` Greg KH
2020-05-24 15:42       ` Sasha Levin
2020-05-25  7:33         ` Greg KH
2020-05-24 17:05       ` Linus Torvalds
2020-05-24 19:45         ` Sasha Levin
2020-05-24 21:12           ` Sasha Levin
2020-05-24 22:28             ` Linus Torvalds
2020-05-24 22:24           ` Linus Torvalds
2020-05-25  7:40         ` Greg KH [this message]
2020-05-23 18:30   ` pr-tracker-bot
2020-05-23 18:30 ` [GIT PULL] Driver core fixes for 5.7-rc7 pr-tracker-bot

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=20200525074020.GC261205@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@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).