From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BFC5C6377D for ; Thu, 22 Jul 2021 17:44:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 166C861249 for ; Thu, 22 Jul 2021 17:44:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 166C861249 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AA46F6B0036; Thu, 22 Jul 2021 13:44:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A54046B005D; Thu, 22 Jul 2021 13:44:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 942216B006C; Thu, 22 Jul 2021 13:44:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0160.hostedemail.com [216.40.44.160]) by kanga.kvack.org (Postfix) with ESMTP id 7E3786B0036 for ; Thu, 22 Jul 2021 13:44:38 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 29E2C180AD838 for ; Thu, 22 Jul 2021 17:44:38 +0000 (UTC) X-FDA: 78390948636.10.B20430A Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by imf28.hostedemail.com (Postfix) with ESMTP id D55CB90000B0 for ; Thu, 22 Jul 2021 17:44:37 +0000 (UTC) Received: by mail-ej1-f46.google.com with SMTP id oz7so9582296ejc.2 for ; Thu, 22 Jul 2021 10:44:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FMX9cI2MjlCU1069Vd1zqMo3Kf3dMHKY0sEauUXVam0=; b=K3iQOQmHVqTjeZYKttIfv+zKQbNyn3kcu35ed4l06BkwQoodEPvM46rTRYaob2swFF M3uONQTNkd2ttJBI6rRncRJxgR6xKPT1Ge46sCEciUKYyf5vPQmWwkcCllIavSJErdVK aPDG491lsbGvi/fD7WhPjLuIxqdPHiKyxZhzZZE43Eum0K0tRPnjzcWThgtjmtjZuwHn pEcrfQfgIbx89SWq27cWFvFr1IOqI55cFRQAE/Hyay5Lmr7tDCMj4Y3Jh18orVJVcgbc iwrF2N8m+4P+wFTf63C5/sFJdCoWulrawmE3K//IwtH7RVFEPRV9nTkqbOMceKBQ3iX/ DOIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FMX9cI2MjlCU1069Vd1zqMo3Kf3dMHKY0sEauUXVam0=; b=HVvP7Rc/Pn3MC5gJS8VrMZNdIqud6Z7l55jJ6z2JUjBt+z6B9NpqXbGGkkZKmbzjkr 1lHASFsV3tWDov6RKmyVSZKcqBdu2b71sqYRX1p2n2v7JRjluEtg3+dz67ttXjMinKkt IR6Vr8lHw71GtOiCdbAsfrpwLSSnuWQPIFyLAaDqEXlzb9PDqkwO4L5ELBOc2iwl1aIO 0qSSRbXvNsPx2SoqRb956kMBlV/H4qO7Z7q/R4kQB8qVI0RYVcGnAq9zjLmzCN/XtQDV FN1sxMYN80lnxGqcsKavh1rA8/4MhhiQmwE2iaUK6pmhy4mj8AQd09jYBc8K6siOMhdN ct2w== X-Gm-Message-State: AOAM533X0HCjcTeB8k5yrlz2vu7vI9e6QmVMlLNO4Q1B8LKLab1Az0UZ ixamZHd4cdeov+P+hjfZPFC9nGSIaE0jEivsjfc= X-Google-Smtp-Source: ABdhPJyQhva9QrVgQiB5Mc+CziB2BT/qgDSdx2J40cjOdBjA2hqReE/i9pS6idiXQHzybnSf9IhsYFQUpVZBkbXPaiA= X-Received: by 2002:a17:906:830a:: with SMTP id j10mr965231ejx.11.1626975876310; Thu, 22 Jul 2021 10:44:36 -0700 (PDT) MIME-Version: 1.0 References: <5812280.fcLxn8YiTP@natalenko.name> <2237123.PRLUojbHBq@natalenko.name> In-Reply-To: From: Zhouyi Zhou Date: Fri, 23 Jul 2021 01:44:24 +0800 Message-ID: Subject: Re: linux-5.13.2: warning from kernel/rcu/tree_plugin.h:359 To: Matthew Wilcox Cc: Chris Clayton , Oleksandr Natalenko , Miaohe Lin , Boqun Feng , paulmck@kernel.org, linux-kernel , stable@vger.kernel.org, Chris Rankin , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , rcu , Andrew Morton , Linux-MM , "Huang, Ying" , Greg KH Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=K3iQOQmH; spf=pass (imf28.hostedemail.com: domain of zhouzhouyi@gmail.com designates 209.85.218.46 as permitted sender) smtp.mailfrom=zhouzhouyi@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam02 X-Stat-Signature: aqsmnheh6nfef8zqzp1cipqxjg39pzz9 X-Rspamd-Queue-Id: D55CB90000B0 X-HE-Tag: 1626975877-600082 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 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