rcu.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhouyi Zhou <zhouzhouyi@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Chris Clayton <chris2553@googlemail.com>,
	Oleksandr Natalenko <oleksandr@natalenko.name>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	paulmck@kernel.org, linux-kernel <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org, Chris Rankin <rankincj@gmail.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	rcu <rcu@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux-MM <linux-mm@kvack.org>,
	"Huang, Ying" <ying.huang@intel.com>,
	Greg KH <gregkh@linuxfoundation.org>
Subject: Re: linux-5.13.2: warning from kernel/rcu/tree_plugin.h:359
Date: Fri, 23 Jul 2021 01:44:24 +0800	[thread overview]
Message-ID: <CAABZP2x_opmE2vh8GRweNvCqogFjJ09UcNq-8t6qZDMsGNY9vA@mail.gmail.com> (raw)
In-Reply-To: <YPlmMnZKgkcLderp@casper.infradead.org>

I apologize sincerely for my irresponsible and hasty email.
I reverted the unnecessary backport of 2799e77529c2 and 2efa33fc7f6e,
tested on the same qemu box as before with the same C program, there
is no warning about RCU this time. dmesg only shows the backtrace of
OOM kill.

As for memory OOMs caused by grace period's undue ends, I found each
deletion of a inode will cause a leak.
1035    void security_inode_free(struct inode *inode)
1036    {
1037        integrity_inode_free(inode);
1038        call_void_hook(inode_free_security, inode);
1039        /*
1040         * The inode may still be referenced in a path walk and
1041         * a call to security_inode_permission() can be made
1042         * after inode_free_security() is called. Ideally, the VFS
1043         * wouldn't do this, but fixing that is a much harder
1044         * job. For now, simply free the i_security via RCU, and
1045         * leave the current inode->i_security pointer intact.
1046         * The inode will be freed after the RCU grace period too.
1047         */
1048        if (inode->i_security)
1049            call_rcu((struct rcu_head *)inode->i_security,
1050                    inode_free_by_rcu);
1051    }

I am willing to do any experiment if there is a need.

Sorry again
Best Wishes
Zhouyi

On Thu, Jul 22, 2021 at 8:36 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Thu, Jul 22, 2021 at 04:57:57PM +0800, Zhouyi Zhou wrote:
> > Thanks for reviewing,
> >
> > What I have deduced from the dmesg  is:
> > In function do_swap_page,
> > after invoking
> > 3385        si = get_swap_device(entry); /* rcu_read_lock */
> > and before
> > 3561    out:
> > 3562        if (si)
> > 3563            put_swap_device(si);
> > The thread got scheduled out in
> > 3454        locked = lock_page_or_retry(page, vma->vm_mm, vmf->flags);
> >
> > I am only familiar with Linux RCU subsystem, hope mm people can solve our
> > confusions.
>
> I don't understamd why you're still talking.  The problem is understood.
> You need to revert the unnecessary backport of 2799e77529c2 and
> 2efa33fc7f6e

  parent reply	other threads:[~2021-07-22 17:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c9fd1311-662c-f993-c8ef-54af036f2f78@googlemail.com>
2021-07-18 21:01 ` linux-5.13.2: warning from kernel/rcu/tree_plugin.h:359 Oleksandr Natalenko
2021-07-18 21:03   ` Oleksandr Natalenko
2021-07-18 21:22     ` Matthew Wilcox
2021-07-18 21:36       ` Chris Clayton
2021-07-18 21:59     ` Paul E. McKenney
2021-07-18 22:51       ` Matthew Wilcox
2021-07-19  1:53         ` Paul E. McKenney
2021-07-19  2:24           ` Zhouyi Zhou
2021-07-19  2:27             ` Zhouyi Zhou
2021-07-19  2:43             ` Matthew Wilcox
2021-07-19  2:59               ` Zhouyi Zhou
2021-07-19 10:14               ` Boqun Feng
2021-07-19 11:12                 ` Miaohe Lin
2021-07-19 11:17                   ` Oleksandr Natalenko
2021-07-19 11:22                   ` Matthew Wilcox
2021-07-19 11:50                     ` Miaohe Lin
2021-07-19 11:59                       ` Oleksandr Natalenko
2021-07-19 12:08                         ` Miaohe Lin
2021-07-19 12:12                           ` Oleksandr Natalenko
2021-07-19 12:16                             ` Matthew Wilcox
2021-07-19 12:23                               ` Oleksandr Natalenko
2021-07-19 16:47                                 ` Zhouyi Zhou
     [not found]                                   ` <CAABZP2yh3J8+P=3PLZVaC47ymKC7PcfQCBBxjXJ9Ybn+HREbdg@mail.gmail.com>
2021-07-22  7:30                                     ` Chris Clayton
2021-07-22  8:57                                       ` Zhouyi Zhou
2021-07-22 12:36                                         ` Matthew Wilcox
2021-07-22 13:26                                           ` Greg KH
2021-07-22 14:00                                             ` Greg KH
2021-07-23  1:51                                               ` Miaohe Lin
2021-07-23  7:02                                                 ` Greg KH
2021-07-23  7:13                                                   ` Miaohe Lin
2021-07-22 17:44                                           ` Zhouyi Zhou [this message]
2021-07-22 14:05                                       ` Paul E. McKenney
2021-07-19 12:17                             ` Miaohe Lin
2021-07-19  7:32       ` Chris Clayton

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=CAABZP2x_opmE2vh8GRweNvCqogFjJ09UcNq-8t6qZDMsGNY9vA@mail.gmail.com \
    --to=zhouzhouyi@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=boqun.feng@gmail.com \
    --cc=chris2553@googlemail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=oleksandr@natalenko.name \
    --cc=paulmck@kernel.org \
    --cc=rankincj@gmail.com \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=stable@vger.kernel.org \
    --cc=willy@infradead.org \
    --cc=ying.huang@intel.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).