Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp733867pxv; Thu, 22 Jul 2021 10:46:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/CYUkuvMIWbtvlwmAl5rDHLLCdaQVFS6SWLlqoZMCxyzKCutuwlajFKoSLm6tOjPbED8T X-Received: by 2002:a17:906:f9c5:: with SMTP id lj5mr988808ejb.482.1626976000262; Thu, 22 Jul 2021 10:46:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626976000; cv=none; d=google.com; s=arc-20160816; b=BAtarK+udCjYrNYRwrT20Fj5lAsBZ4v1gAwZdwIP1caBzuc5VlUj4UPFbuiY+MtuRb wesbOSU1O4hPP+n1qa20N7h045iDbdyhjGyVdmNLOV9qX5FAJwSTswaHh/WGaKtGqWFz ZkDQdfGR5wy63FVlXjAP8JM1ewzrxIB1SDTo8Lzmh+s8hkUwxFHfZnaxzNkgZLGGFto0 Wm9MEqlOEr3P9DDay4z8KbE8sLw2sC+6tbjT+ju7xs6Nks4CjI4ZLfaum/XCskr684iP 1OVKbd9BUAwy82ApZKNZSf+GyYycDQl5rhFq2C1ahHtuKH0gavp0t1a7PhNf6fFokL+8 26sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=FMX9cI2MjlCU1069Vd1zqMo3Kf3dMHKY0sEauUXVam0=; b=0av7GAWCGdxBQi9QKy3u69lu8XSm9D7UJ3F07750lm29L9TNIC2FdTaxgvmoY4fe9x /2j4fjwHMV6zHvQHZZCUVN/QpeNr5qHj4+1+bLiriAeHS9Cn84CUfsjutZ1clkTXLhsl om/WhfDMHKQV0qgt5O99rQXv7fZqf23Xk99+xuUOloi90AO6FmmV0akzDvPnZ7bDJN3A OxtnBK4gf3KElUz+aBldEFk5Ye/MgPM4WDgik8ckd3whEl1ChYMMGfXIGQlHf9+PQ2PC CVEv+wfqeAGk+rWg9xL9dDYNqW6E1tVmKPByB1CC6yjZqy/Xw6YPE+KIljvywtaJ7ahJ U0cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K3iQOQmH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b23si34359857edv.199.2021.07.22.10.46.15; Thu, 22 Jul 2021 10:46:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=K3iQOQmH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230035AbhGVREF (ORCPT + 99 others); Thu, 22 Jul 2021 13:04:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbhGVRED (ORCPT ); Thu, 22 Jul 2021 13:04:03 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1934C061575; Thu, 22 Jul 2021 10:44:37 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id bu12so9645577ejb.0; 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=rt+aAYCdr9pC4sWIUWyea8aBiU668WEkXfmNTNibZ5eOZYLzcUmAR/gLsOPKRXrBoN fHhie8rWUVznjKlM3v1BKhzSq0Zi2zBnLI7gUOqYT+FbPgEOMPTDuk9OsGLFJ2+0g9AO 9lJGZAgXq1EYOtf0sMqTKnG9tTHvRcAgGaasDJDUH5PNv2ID3hg9hTnf+AquxnaL7ibz X2OIqWJGK/nN5AmqcJHySzvLl6DKvJM20PV4dLeH2eJAQMk9hjyTjWekGJI5+1bz+NIS Unr8dyt/wMt6mqTmuYSxIeLq+OUwgo9uVOKgFzkZhDk/22SL6sWww3ajoAUhqsFQRn8G SN0w== X-Gm-Message-State: AOAM530z/r736oSxGyn0je2lV89vohFNgcd1hHDqB6E6O+ANdli5JVGM o4zKA3wx0Y7f5OwQn1zKRSNHSuAnbQwDCDcwc24= 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 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