All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Zickus <dzickus@redhat.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-watchdog@vger.kernel.org, kexec@lists.infradead.org,
	LKML <linux-kernel@vger.kernel.org>,
	wim@iguana.be, Dave Young <dyoung@redhat.com>,
	vgoyal@redhat.com
Subject: Re: [RFC PATCH] watchdog: Add hook for kicking in kdump path
Date: Mon, 15 Apr 2013 16:55:04 -0400	[thread overview]
Message-ID: <20130415205504.GQ79013@redhat.com> (raw)
In-Reply-To: <20130412213024.GA5812@roeck-us.net>

On Fri, Apr 12, 2013 at 02:30:24PM -0700, Guenter Roeck wrote:
> On Fri, Apr 12, 2013 at 05:16:27PM -0400, Don Zickus wrote:
> > On Wed, Apr 10, 2013 at 08:10:41AM -0700, Guenter Roeck wrote:
> > > > have no idea how to even find out if multiple watchdogs are open on the
> > > > system.  Is there a list I could walk?  And with regard to 'watchdog is
> > > 
> > > /* the dev_t structure to store the dynamically allocated watchdog devices */
> > > static dev_t watchdog_devt;
> > > 
> > > One way to look up the allocated watchdogs might be to loop through all kobj
> > > instances for the major device using kobj_lookup. Don't know if there is a
> > > better way.
> > 
> > Hmm, I got around to poking at this today and I am not sure kobj_lookup
> > will work.  Besides being surrounded with another mutex, I don't have
> > access to the character device domain to pass to kobj_lookup.
> > 
> > Perhaps I am not reading the code right, but I can't find a good way
> > forward.
> > 
> > The only other hack I can think of, is to embed a list object in the
> > watchdog structure and list_add each new register'd watchdog.  Then it
> > would be trivial to walk the watchdog list.
> > 
> After looking into it again, I agree. Maybe you can give it a try. At least
> other options look even more complicated (eg creating a watchdog class ?).

I looked at the watchdog class in watchdog_core.c.  Even implemented
class_for_each_device.  But got stuck trying to figure out how to go from
a struct device *dev to a struct watchdog_device.  Then I realized in the
bowels of class_for_each_device were spinlocks. :-(

So I implemented an RCU list.  It isn't the prettiest solution but it
seems to work.

I posted a V2 and realized I forgot to cc you on it.  I apologize for
that. :-(  I hope you can find it, otherwise I can post a pointer to it.

Cheers,
Don

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

WARNING: multiple messages have this Message-ID (diff)
From: Don Zickus <dzickus@redhat.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Dave Young <dyoung@redhat.com>,
	linux-watchdog@vger.kernel.org, kexec@lists.infradead.org,
	wim@iguana.be, LKML <linux-kernel@vger.kernel.org>,
	vgoyal@redhat.com
Subject: Re: [RFC PATCH] watchdog: Add hook for kicking in kdump path
Date: Mon, 15 Apr 2013 16:55:04 -0400	[thread overview]
Message-ID: <20130415205504.GQ79013@redhat.com> (raw)
In-Reply-To: <20130412213024.GA5812@roeck-us.net>

On Fri, Apr 12, 2013 at 02:30:24PM -0700, Guenter Roeck wrote:
> On Fri, Apr 12, 2013 at 05:16:27PM -0400, Don Zickus wrote:
> > On Wed, Apr 10, 2013 at 08:10:41AM -0700, Guenter Roeck wrote:
> > > > have no idea how to even find out if multiple watchdogs are open on the
> > > > system.  Is there a list I could walk?  And with regard to 'watchdog is
> > > 
> > > /* the dev_t structure to store the dynamically allocated watchdog devices */
> > > static dev_t watchdog_devt;
> > > 
> > > One way to look up the allocated watchdogs might be to loop through all kobj
> > > instances for the major device using kobj_lookup. Don't know if there is a
> > > better way.
> > 
> > Hmm, I got around to poking at this today and I am not sure kobj_lookup
> > will work.  Besides being surrounded with another mutex, I don't have
> > access to the character device domain to pass to kobj_lookup.
> > 
> > Perhaps I am not reading the code right, but I can't find a good way
> > forward.
> > 
> > The only other hack I can think of, is to embed a list object in the
> > watchdog structure and list_add each new register'd watchdog.  Then it
> > would be trivial to walk the watchdog list.
> > 
> After looking into it again, I agree. Maybe you can give it a try. At least
> other options look even more complicated (eg creating a watchdog class ?).

I looked at the watchdog class in watchdog_core.c.  Even implemented
class_for_each_device.  But got stuck trying to figure out how to go from
a struct device *dev to a struct watchdog_device.  Then I realized in the
bowels of class_for_each_device were spinlocks. :-(

So I implemented an RCU list.  It isn't the prettiest solution but it
seems to work.

I posted a V2 and realized I forgot to cc you on it.  I apologize for
that. :-(  I hope you can find it, otherwise I can post a pointer to it.

Cheers,
Don

  reply	other threads:[~2013-04-15 20:55 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1365192994-94850-1-git-send-email-dzickus@redhat.com>
2013-04-08  5:46 ` [RFC PATCH] watchdog: Add hook for kicking in kdump path Dave Young
2013-04-08  5:46   ` Dave Young
2013-04-08 12:48   ` Don Zickus
2013-04-08 12:48     ` Don Zickus
2013-04-08 15:15     ` Guenter Roeck
2013-04-08 15:15       ` Guenter Roeck
2013-04-09 14:44       ` Don Zickus
2013-04-09 14:44         ` Don Zickus
2013-04-09 14:52         ` Guenter Roeck
2013-04-09 14:52           ` Guenter Roeck
2013-04-09 15:14           ` Don Zickus
2013-04-09 15:14             ` Don Zickus
2013-04-09 16:07             ` Guenter Roeck
2013-04-09 16:07               ` Guenter Roeck
2013-04-10 13:40               ` Don Zickus
2013-04-10 13:40                 ` Don Zickus
2013-04-10 13:51                 ` Guenter Roeck
2013-04-10 13:51                   ` Guenter Roeck
2013-04-10 14:20                   ` Don Zickus
2013-04-10 14:20                     ` Don Zickus
2013-04-10 15:10                     ` Guenter Roeck
2013-04-10 15:10                       ` Guenter Roeck
2013-04-10 16:17                       ` Don Zickus
2013-04-10 16:17                         ` Don Zickus
2013-04-10 16:30                         ` Guenter Roeck
2013-04-10 16:30                           ` Guenter Roeck
2013-04-12 21:16                       ` Don Zickus
2013-04-12 21:16                         ` Don Zickus
2013-04-12 21:30                         ` Guenter Roeck
2013-04-12 21:30                           ` Guenter Roeck
2013-04-15 20:55                           ` Don Zickus [this message]
2013-04-15 20:55                             ` Don Zickus
2013-04-15 22:50                             ` Guenter Roeck
2013-04-15 22:50                               ` Guenter Roeck
2013-04-10 16:49                 ` David Teigland
2013-04-10 16:49                   ` David Teigland
2013-04-10 17:17                   ` Guenter Roeck
2013-04-10 17:17                     ` Guenter Roeck

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=20130415205504.GQ79013@redhat.com \
    --to=dzickus@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=vgoyal@redhat.com \
    --cc=wim@iguana.be \
    /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.