linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
To: "max.kellermann@ionos.com" <max.kellermann@ionos.com>
Cc: Xiubo Li <xiubli@redhat.com>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netfs@lists.linux.dev" <netfs@lists.linux.dev>,
	Alex Markuze <amarkuze@redhat.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"idryomov@gmail.com" <idryomov@gmail.com>,
	"mjguzik@gmail.com" <mjguzik@gmail.com>
Subject: RE: [PATCH v2] ceph: fix deadlock bugs by making iput() calls asynchronous
Date: Wed, 17 Sep 2025 19:20:01 +0000	[thread overview]
Message-ID: <3c36023271ed916f502d03e4e2e76da711c43ebf.camel@ibm.com> (raw)
In-Reply-To: <CAKPOu+_xxLjTC6RyChmwn_tR-pATEDLMErkzqFjGwuALgMVK6g@mail.gmail.com>

On Wed, 2025-09-17 at 21:06 +0200, Max Kellermann wrote:
> On Wed, Sep 17, 2025 at 7:55 PM Viacheslav Dubeyko
> <Slava.Dubeyko@ibm.com> wrote:
> > > +     doutc(ceph_inode_to_fs_client(inode)->client, "%p %llx.%llx\n", inode, ceph_vinop(inode));
> > 
> > What's about this?
> > 
> > struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode);
> > 
> > doutc(fsc, "%p %llx.%llx\n", inode, ceph_vinop(inode));
> 
> That means I have to declare this variable at the beginning of the
> function because the kernel unfortunately still doesn't allow C99
> rules (declare variables where they are used). And that means paying
> the overhead for chasing 3 layers of pointers for all callers, even
> those 99.99% who return early. Or declare the variable but initialize
> it later in an extra line. Is that the preferred coding style?

My worries here that it is too long statement. Maybe, we can make it as two
lines statement then? For example:

doutc(ceph_inode_to_fs_client(inode)->client, "%p %llx.%llx\n",
      inode, ceph_vinop(inode));

> 
> > > +     WARN_ON_ONCE(!queue_work(ceph_inode_to_fs_client(inode)->inode_wq,
> > > +                              &ceph_inode(inode)->i_work));
> > 
> > This function looks like ceph_queue_inode_work() [1]. Can we use
> > ceph_queue_inode_work()?
> 
> No, we can not, because that function adds an inode reference (instead
> of donating the existing reference) and there's no way we can safely
> get rid of it (even if we would accept paying the overhead of two
> extra atomic operations).

This function can call iput() too. Should we rework it, then? Also, as a result,
we will have two similar functions. And it could be confusing.

Thanks,
Slava.


  reply	other threads:[~2025-09-17 19:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17 13:59 [PATCH v2] ceph: fix deadlock bugs by making iput() calls asynchronous Max Kellermann
2025-09-17 14:12 ` Mateusz Guzik
2025-09-17 17:55 ` Viacheslav Dubeyko
2025-09-17 19:06   ` Max Kellermann
2025-09-17 19:20     ` Viacheslav Dubeyko [this message]
2025-09-17 19:25       ` Max Kellermann
2025-09-17 19:33         ` Viacheslav Dubeyko
2025-09-17 20:20 ` Al Viro
2025-09-17 20:25   ` Max Kellermann
2025-09-17 20:27     ` Max Kellermann
2025-09-18  4:52 ` Max Kellermann

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=3c36023271ed916f502d03e4e2e76da711c43ebf.camel@ibm.com \
    --to=slava.dubeyko@ibm.com \
    --cc=amarkuze@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=max.kellermann@ionos.com \
    --cc=mjguzik@gmail.com \
    --cc=netfs@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=xiubli@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 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).