All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Subject: Re: [PATCH] block: don't embed integrity_kobj into gendisk
Date: Thu, 09 Mar 2023 16:20:25 -0500	[thread overview]
Message-ID: <yq1zg8lbqye.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <20230309-kobj_release-gendisk_integrity-v1-1-a240f54eac60@weissschuh.net> ("Thomas =?utf-8?Q?Wei=C3=9Fschuh=22's?= message of "Thu, 09 Mar 2023 20:23:41 +0000")


Hi Thomas!

> A struct kobject is only supposed to be embedded into objects which
> lifetime it will manage.  Objects of type struct gendisk however are
> refcounted by their part0 block_device.  Therefore the integrity_kobj
> should not be embedded but split into its own independently managed
> object.

That's how we originally did it. However, this caused problems for a
couple of subsystems, NVMe and DM, if I remember correctly.

Managing the lifetime of request_queue vs. gendisk vs. blk_integrity
proved to be tricky. Basically at the time things were allocated we
didn't yet have all the information required to complete the block
device setup. We had to be able to send commands to the drive to finish
probing for all the relevant parameters. That dependency was the
rationale behind inlining the blk_integrity into gendisk so it was
always available. Hazy on the details, this was a long time ago.

Another option would be to reshuffle the sysfs bits. The kobj really
isn't used for anything else.

-- 
Martin K. Petersen	Oracle Linux Engineering

  parent reply	other threads:[~2023-03-09 21:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 20:23 [PATCH] block: don't embed integrity_kobj into gendisk Thomas Weißschuh
2023-03-09 21:05 ` Mirsad Goran Todorovac
2023-03-09 21:23   ` Thomas Weißschuh
2023-03-09 21:46     ` Mirsad Goran Todorovac
2023-03-09 23:26       ` Thomas Weißschuh
2023-03-10  8:52         ` Mirsad Todorovac
2023-03-10 13:42           ` Andy Shevchenko
2023-03-09 21:47     ` Andy Shevchenko
2023-03-09 21:20 ` Martin K. Petersen [this message]
2023-03-14  9:15 ` kernel test robot

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=yq1zg8lbqye.fsf@ca-mkp.ca.oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=mirsad.todorovac@alu.unizg.hr \
    /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.