All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Pavel Machek <pavel@ucw.cz>, Akinobu Mita <akinobu.mita@gmail.com>
Cc: linux-block@vger.kernel.org, linux-leds@vger.kernel.org,
	linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org,
	Frank Steiner <fsteiner-mail1@bio.ifi.lmu.de>,
	Dan Murphy <dmurphy@ti.com>, Jens Axboe <axboe@kernel.dk>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Hannes Reinecke <hare@suse.com>
Subject: Re: [PATCH v4 4/5] block: introduce LED block device activity trigger
Date: Sat, 17 Aug 2019 22:07:43 +0200	[thread overview]
Message-ID: <925633c4-a459-5e84-9c9a-502a504fdc82@gmail.com> (raw)
In-Reply-To: <20190817145509.GA18381@amd>

On 8/17/19 4:55 PM, Pavel Machek wrote:
> On Fri 2019-08-16 01:59:58, Akinobu Mita wrote:
>> This allows LEDs to be controlled by block device activity.
>>
>> We already have ledtrig-disk (LED disk activity trigger), but the lower
>> level disk drivers need to utilize ledtrig_disk_activity() to make the
>> LED blink.
>>
>> The LED block device trigger doesn't require the lower level drivers to
>> have any instrumentation. The activity is collected by polling the disk
>> stats.
>>
>> Example:
>>
>> echo block-nvme0n1 > /sys/class/leds/diy/trigger
> 
> Lets use one trigger "block" and have the device as a parameter,
> please.
> 
> We already have 1000 cpu triggers on 1000 cpu machines, and yes, its a
> disaster we'll need to fix. Lets not repeat the same mistake here.
> 
> I guess it may be slightly more work. Sorry about that.

We should be able to list available block devices to set,
so the problem would be not avoided anyway. And Greg already proposed
a solution for trigger file PAGE_SIZE overflow, so this should not pose
a big problem in the future once that is implemented.

> 								Pavel
> 
>> +++ b/include/linux/leds.h
>> +#else
>> +
>> +struct ledtrig_blk {
>> +};
>> +
> 
> Is the empty struct neccessary?

Yeah, I didn't like that too and tried to play with the code to turn
it into a pointer but it turned out to be non-trivial.

The thing is that struct ledtrig_blk is made a property of
struct gendisk, which then allows to get a pointer to the struct gendisk
of the registrar in ledtrig_blk_work() via container_of macro.

Initially I did not realize the problem and asked Akinobu to move the
trigger implementation to the LED subsystem since it seems to have
likely broad use and it would be good to have it visible in the LED
triggers config menu.

That move unfortunately entails the cumbersome dependency we're
discussing now. It's to be decided then if it wouldn't be cleaner
to have that trigger entirely implemented on gendisk side.

>> +static inline void ledtrig_blk_enable(struct gendisk *disk)
>> +{
>> +}
>> +
>> +static inline void ledtrig_blk_disable(struct gendisk *disk)
>> +{
>> +}
>> +
>> +static inline int ledtrig_blk_register(struct gendisk *disk)
>> +{
>> +	return 0;
>> +}
>> +
>> +static inline void ledtrig_blk_unregister(struct gendisk *disk)
>> +{
>> +}
> 
> Normally we put such empty functions on single lines...
> 
> Best regards,
> 									     Pavel
> 

-- 
Best regards,
Jacek Anaszewski



WARNING: multiple messages have this Message-ID (diff)
From: jacek.anaszewski@gmail.com (Jacek Anaszewski)
Subject: [PATCH v4 4/5] block: introduce LED block device activity trigger
Date: Sat, 17 Aug 2019 22:07:43 +0200	[thread overview]
Message-ID: <925633c4-a459-5e84-9c9a-502a504fdc82@gmail.com> (raw)
In-Reply-To: <20190817145509.GA18381@amd>

On 8/17/19 4:55 PM, Pavel Machek wrote:
> On Fri 2019-08-16 01:59:58, Akinobu Mita wrote:
>> This allows LEDs to be controlled by block device activity.
>>
>> We already have ledtrig-disk (LED disk activity trigger), but the lower
>> level disk drivers need to utilize ledtrig_disk_activity() to make the
>> LED blink.
>>
>> The LED block device trigger doesn't require the lower level drivers to
>> have any instrumentation. The activity is collected by polling the disk
>> stats.
>>
>> Example:
>>
>> echo block-nvme0n1 > /sys/class/leds/diy/trigger
> 
> Lets use one trigger "block" and have the device as a parameter,
> please.
> 
> We already have 1000 cpu triggers on 1000 cpu machines, and yes, its a
> disaster we'll need to fix. Lets not repeat the same mistake here.
> 
> I guess it may be slightly more work. Sorry about that.

We should be able to list available block devices to set,
so the problem would be not avoided anyway. And Greg already proposed
a solution for trigger file PAGE_SIZE overflow, so this should not pose
a big problem in the future once that is implemented.

> 								Pavel
> 
>> +++ b/include/linux/leds.h
>> +#else
>> +
>> +struct ledtrig_blk {
>> +};
>> +
> 
> Is the empty struct neccessary?

Yeah, I didn't like that too and tried to play with the code to turn
it into a pointer but it turned out to be non-trivial.

The thing is that struct ledtrig_blk is made a property of
struct gendisk, which then allows to get a pointer to the struct gendisk
of the registrar in ledtrig_blk_work() via container_of macro.

Initially I did not realize the problem and asked Akinobu to move the
trigger implementation to the LED subsystem since it seems to have
likely broad use and it would be good to have it visible in the LED
triggers config menu.

That move unfortunately entails the cumbersome dependency we're
discussing now. It's to be decided then if it wouldn't be cleaner
to have that trigger entirely implemented on gendisk side.

>> +static inline void ledtrig_blk_enable(struct gendisk *disk)
>> +{
>> +}
>> +
>> +static inline void ledtrig_blk_disable(struct gendisk *disk)
>> +{
>> +}
>> +
>> +static inline int ledtrig_blk_register(struct gendisk *disk)
>> +{
>> +	return 0;
>> +}
>> +
>> +static inline void ledtrig_blk_unregister(struct gendisk *disk)
>> +{
>> +}
> 
> Normally we put such empty functions on single lines...
> 
> Best regards,
> 									     Pavel
> 

-- 
Best regards,
Jacek Anaszewski

  reply	other threads:[~2019-08-17 20:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-15 16:59 [PATCH v4 0/5] introduce LED block device activity trigger Akinobu Mita
2019-08-15 16:59 ` Akinobu Mita
2019-08-15 16:59 ` [PATCH v4 1/5] block: umem: rename LED_* macros to MEMCTRL_LED_* Akinobu Mita
2019-08-15 16:59   ` Akinobu Mita
2019-08-15 16:59 ` [PATCH v4 2/5] scsi: mvsas: rename LED_* enums to SGPIO_LED_* Akinobu Mita
2019-08-15 16:59   ` Akinobu Mita
2019-08-15 16:59 ` [PATCH v4 3/5] scsi: nsp32: rename LED_* macros to EXT_PORT_LED_* Akinobu Mita
2019-08-15 16:59   ` Akinobu Mita
2019-08-15 16:59 ` [PATCH v4 4/5] block: introduce LED block device activity trigger Akinobu Mita
2019-08-15 16:59   ` Akinobu Mita
2019-08-17 14:55   ` Pavel Machek
2019-08-17 14:55     ` Pavel Machek
2019-08-17 20:07     ` Jacek Anaszewski [this message]
2019-08-17 20:07       ` Jacek Anaszewski
2019-08-19 14:38       ` Pavel Machek
2019-08-19 18:22         ` Jacek Anaszewski
2019-08-19 18:37           ` Jacek Anaszewski
2019-08-23 16:00             ` Akinobu Mita
2019-08-24 15:53               ` Jacek Anaszewski
2019-08-27 14:03                 ` Akinobu Mita
2019-08-27 21:23                   ` Jacek Anaszewski
2019-08-28 14:56                     ` Akinobu Mita
2019-08-15 16:59 ` [PATCH v4 5/5] scsi: sd: stop polling disk stats by ledtrig-blk during runtime suspend Akinobu Mita
2019-08-15 16:59   ` Akinobu Mita
2019-08-16 19:52   ` Jacek Anaszewski
2019-08-16 19:52     ` Jacek Anaszewski

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=925633c4-a459-5e84-9c9a-502a504fdc82@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=akinobu.mita@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=dmurphy@ti.com \
    --cc=fsteiner-mail1@bio.ifi.lmu.de \
    --cc=hare@suse.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=pavel@ucw.cz \
    /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.