Message ID | 20230116034405.2960276-1-yuzhao@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66F91C54EBE for <linux-mm@archiver.kernel.org>; Mon, 16 Jan 2023 03:44:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8E65F6B0071; Sun, 15 Jan 2023 22:44:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 895A76B0072; Sun, 15 Jan 2023 22:44:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 75D496B0073; Sun, 15 Jan 2023 22:44:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 66ED56B0071 for <linux-mm@kvack.org>; Sun, 15 Jan 2023 22:44:10 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 0A165A01E3 for <linux-mm@kvack.org>; Mon, 16 Jan 2023 03:44:10 +0000 (UTC) X-FDA: 80359269060.11.FB12497 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) by imf19.hostedemail.com (Postfix) with ESMTP id 8CF7C1A0007 for <linux-mm@kvack.org>; Mon, 16 Jan 2023 03:44:08 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=DbXiQgb1; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf19.hostedemail.com: domain of 3B8jEYwYKCM4IEJ1u808805y.w86527EH-664Fuw4.8B0@flex--yuzhao.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3B8jEYwYKCM4IEJ1u808805y.w86527EH-664Fuw4.8B0@flex--yuzhao.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673840648; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=FRXb5Tx9eB0QD8MPQ3bDTUMYKB42PbWbukVcWDbrGBE=; b=yKrtb70bEkeoWAhx99rAzRVciMxyF8+OJEumgJVF6vztTKvlNbZYg+TbfBrGB0yQdt7FB4 aiJloGqHtT5VDT69x62y45nfvc/OCJa/D0CI9Jk2uzQVIRpPGbviiIc9h6nQ4NcSzjurb2 FtQWirjlFRZShK2JU3EgJZ17HzGmiBw= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=DbXiQgb1; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf19.hostedemail.com: domain of 3B8jEYwYKCM4IEJ1u808805y.w86527EH-664Fuw4.8B0@flex--yuzhao.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3B8jEYwYKCM4IEJ1u808805y.w86527EH-664Fuw4.8B0@flex--yuzhao.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673840648; a=rsa-sha256; cv=none; b=UmgiSQIEdIxzI4U1OK7zIqmII8ZPmgn3++gO1eso93BKCBIqk49Cuf16p9JsKLqiRq8xCG 9aG7l0vS5uD3tRnTJ2KPqco+QynW8kXAbpUSOXV1votjaWdy3z9j+gbUVcSpgzYekbS0yR tp5jkMnurmVYxXhPeNrDQJc6rnEd2Ls= Received: by mail-yb1-f202.google.com with SMTP id h66-20020a252145000000b0071a7340eea9so29297829ybh.6 for <linux-mm@kvack.org>; Sun, 15 Jan 2023 19:44:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=FRXb5Tx9eB0QD8MPQ3bDTUMYKB42PbWbukVcWDbrGBE=; b=DbXiQgb16cXc0c+1Ms81Hey0/LYqSzODb9phkheLoa2O8f3Ig92mTiQHSCrotArslU FEhihvxAu74eZD4ZQe4lTANr5P5IpZ55hmjNXVmwzm9h7sRX2FMGYLVTwiaWm1ZkUjKH pFtLaSOiV+aW76Yi83BTtq0/BrDt/QaUwk97NMS5Sq4Cb3L2/vr4KLaNpNLQ8XBHU+a6 hahZrekdCCHtViDqFgpx0LlxuyMZ/IYBQSlN37323erCpSDPaVessn4Ls1Em2E92Sw44 oXeBPF4ZzWX50UHybSL9f4sTMOwB3Nl2zVKANoYCGcvJkLRVQx3peuXbl7WTm23Qno3H V55g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=FRXb5Tx9eB0QD8MPQ3bDTUMYKB42PbWbukVcWDbrGBE=; b=Ue9QM7BKeoeJw4NmjKL/fPCLeVxXo0RrTiqXjSAVfBGK25KnRnXydM+1X2kBM4pos+ uQjWQEUCgUB8acTA8Y4Z5tbHuASKYPcch51BL30CPVuL2Ksy3Gtes4/ily2+QsZ8w0vw 1yylBFfAZJ4n6CdAcIZmMS9yROzV20HqZr9XljBFE2rBW6ml2Bt0ONKpHj6ewtzPwdR5 PQh089AVU8zto/lDHS/+yEKpHptPbU2zecOIAqGsAmugbtMuATu55CYMiBsXV0ychhE2 YM0LNWvs647+P0R0ZHeiOXDITLPZdoWK9jWJjEaQcq3OG5g8CGw9KysbsDuGs+tdJq/N p0Lw== X-Gm-Message-State: AFqh2kryVHqsgEfQtP0fRuFqpNXBKlpdOjAKD8O9eDgo8YH7FWnnEIaT HmwN44uvckYJV/MpKLuFhOSWWTm+uU8= X-Google-Smtp-Source: AMrXdXvLWad4bD9NfwO8dLR/2EI357BTUrAnmpF0KOigylM+0w18WGKH/mk2AkTunNN50QaDroPabDG7MY8= X-Received: from yuzhao.bld.corp.google.com ([2620:15c:183:200:9283:334a:bf40:242b]) (user=yuzhao job=sendgmr) by 2002:a25:f903:0:b0:7b9:daf2:4117 with SMTP id q3-20020a25f903000000b007b9daf24117mr4108825ybe.408.1673840647568; Sun, 15 Jan 2023 19:44:07 -0800 (PST) Date: Sun, 15 Jan 2023 20:44:05 -0700 Message-Id: <20230116034405.2960276-1-yuzhao@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Subject: [PATCH mm-unstable v1] mm: multi-gen LRU: fix crash during cgroup migration From: Yu Zhao <yuzhao@google.com> To: Andrew Morton <akpm@linux-foundation.org> Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-mm@google.com, Yu Zhao <yuzhao@google.com>, msizanoen <msizanoen@qtmlabs.xyz>, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 8CF7C1A0007 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: r9uayetde8ajhitqgtfp5cdbq44z6qc3 X-HE-Tag: 1673840648-956544 X-HE-Meta: U2FsdGVkX1/YdMw2rdyFm7debRRwp9mx44tS2bceV97G6mx3Bf622Zhf3vh5Vj3w1bhJvIwozOAUQvDEOj7dQcBR78wxIyQCrihXKHcsEwSY87mkUe6RUtMdIckn0345lYxWmLX75WzTHLPaJ/klWYdTEXVHo58mUOzg/9ey9173+NxwoYEoxcviVNkGjCQXFRrlJmLK/7qeOxDs+EaE+5+tAJ+7c6WT4x3UZAWAaeifCwXNmk698YQdw4xKqC7lykq8P3uvS1r1ugUzAGIUHKDc3OWSKO5jbb40NtvFhU8zK8PZcHStQQgkxh/H9zf5+R/yaRrUMKyJEIhR4yR1Fdz5I9swrH7g+ePIoKrFMZ3uVL/cfswqTx/j23W4lNuTFSXi0ZlN09i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version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
[mm-unstable,v1] mm: multi-gen LRU: fix crash during cgroup migration
|
expand
|
diff --git a/mm/vmscan.c b/mm/vmscan.c index cdf96aec39dc..394ff4962cbc 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3335,13 +3335,16 @@ void lru_gen_migrate_mm(struct mm_struct *mm) if (mem_cgroup_disabled()) return; + /* migration can happen before addition */ + if (!mm->lru_gen.memcg) + return; + rcu_read_lock(); memcg = mem_cgroup_from_task(task); rcu_read_unlock(); if (memcg == mm->lru_gen.memcg) return; - VM_WARN_ON_ONCE(!mm->lru_gen.memcg); VM_WARN_ON_ONCE(list_empty(&mm->lru_gen.list)); lru_gen_del_mm(mm);