Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5475245iog; Wed, 22 Jun 2022 21:41:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ssq/HWNMTKFH7SyqXwEYkh+NCw+dXWVI/HtrZNlXbra9ni4qoBlbUdU6C96uARhUMWwCYi X-Received: by 2002:a17:90b:3805:b0:1e6:85aa:51b with SMTP id mq5-20020a17090b380500b001e685aa051bmr1999658pjb.182.1655959301257; Wed, 22 Jun 2022 21:41:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655959301; cv=none; d=google.com; s=arc-20160816; b=yd5yghcf10Gj33C2CUYm37yBwVrcrmUuCqYBw5Qh8H7I670XupjkO7L59dKLnjBWby ZPRa76FbeSeuLBUa8A5akvOpJz1RNzXrUXie41uDePVMBN5i+QPMd2afXXFyVlNbcf3K PvomWZEdYgzSMk61sj5Nsj9ZCV6AoHmdGXrsXhlNQ3tTZINQiy2m8Rj3LFtfsupE7xg7 Pti4pRSAVMBlUfDKeR3iVtXgX/DGhsF1di8+sLKSVAxpdYeQ/42dvUr0JtE14ETbqHOh azI+8IEeNtX0zWvVPoJoKs7oLlWKD9PdzdL7L6nK5OSr3DRSFsZC/rMZU2IIyeEmtUPc YDjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=Ef3A1jFIk2ghqaCFE7HOz1021sh7n1eb4f8YSnsvNOY=; b=mWfrLCqP3O+Q4ydUgOiXZSBz+APhH73lMd2Ypt9nFFEdhITmmBJkMemPI6TIeZA99H XSLuZM5eWilnYYPSbWUurmg1mnousOA+EFL1lqF+PTNfNoARL8DpWJJjiQltg6xTOdh2 R8iY5Nqr6EdIjFW6eGmD0vBBxrzVYBjA84wZ9hfB1gsVcBYkpVyPggsbNPt/H9nlq1w0 vAG9oz3iFypd+3O6nK+ocqBpQ338YuKbX1L0Cb3Gs3P70r+uGMLN9d3IaqDNQQebfMLv I8ZXGVTAfREsXl2nEc0BmxVirPxI9PG9Xur9hSKLYFV3PQBQOCIRtq6tTQRuzAKbaown xqrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ViJppFGo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020a63eb08000000b003f6ba0c3a6csi24993052pgh.80.2022.06.22.21.41.25; Wed, 22 Jun 2022 21:41:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ViJppFGo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235403AbiFWCxw (ORCPT + 99 others); Wed, 22 Jun 2022 22:53:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377707AbiFWCwo (ORCPT ); Wed, 22 Jun 2022 22:52:44 -0400 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2BCE43EC0; Wed, 22 Jun 2022 19:52:33 -0700 (PDT) Date: Wed, 22 Jun 2022 19:52:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1655952751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ef3A1jFIk2ghqaCFE7HOz1021sh7n1eb4f8YSnsvNOY=; b=ViJppFGoJrwP5h680sfYXw1Y9s8cIL0aKAFEl4ZiYQmr6iSkfPVYxsUcUNGXKZIiTskxQU vmVaYfTWetOSQCr9u8cv9FiHmJy6qauUqIRPKcmypu9C/UxZtdgNyFLNfUl6Mh2NEklMIR +cRZGMjxvfj5QKmWeBjqr3rN77zYeqI= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Muchun Song Cc: syzbot , akpm@linux-foundation.org, cgroups@vger.kernel.org, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mhocko@kernel.org, shakeelb@google.com, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] WARNING in folio_lruvec_lock_irqsave Message-ID: References: <0000000000004b03c805e2099bf0@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 22, 2022 at 11:33:48PM +0800, Muchun Song wrote: > On Wed, Jun 22, 2022 at 06:49:31AM -0700, syzbot wrote: > > Hello, > > > > syzbot found the following issue on: > > > > HEAD commit: ac0ba5454ca8 Add linux-next specific files for 20220622 > > git tree: linux-next > > console output: https://syzkaller.appspot.com/x/log.txt?x=14354c18080000 > > kernel config: https://syzkaller.appspot.com/x/.config?x=12809dacb9e7c5e0 > > dashboard link: https://syzkaller.appspot.com/bug?extid=ec972d37869318fc3ffb > > compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 > > > > Unfortunately, I don't have any reproducer for this issue yet. > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > Reported-by: syzbot+ec972d37869318fc3ffb@syzkaller.appspotmail.com > > > > folio_put include/linux/mm.h:1227 [inline] > > put_page+0x217/0x280 include/linux/mm.h:1279 > > unmap_and_move_huge_page mm/migrate.c:1343 [inline] > > migrate_pages+0x3dc3/0x5a10 mm/migrate.c:1440 > > do_mbind mm/mempolicy.c:1332 [inline] > > kernel_mbind+0x4d7/0x7d0 mm/mempolicy.c:1479 > > do_syscall_x64 arch/x86/entry/common.c:50 [inline] > > do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 > > entry_SYSCALL_64_after_hwframe+0x46/0xb0 > > page has been migrated, last migrate reason: mempolicy_mbind > > ------------[ cut here ]------------ > > WARNING: CPU: 1 PID: 18925 at include/linux/memcontrol.h:800 folio_lruvec include/linux/memcontrol.h:800 [inline] > > The warning here is "VM_WARN_ON_ONCE_FOLIO(!memcg && !mem_cgroup_disabled(), folio)", > the memcg returned by folio_memcg() seems to be NULL which has 2 possibility, one is > that objcg returned by folio_objcg() is NULL, another is that obj_cgroup_memcg(objcg) > returns NULL. However, obj_cgroup_memcg() always returns a valid memcg. So Most likely > objcg is NULL meaning this page is not charged to memcg. Is this possible for LRU pages? > > I am not sure if this issue is caused by my commit cca700a8e695 ("mm: lru: use lruvec > lock to serialize memcg changes") since I have removed folio_test_clear_lru() check > from folio_batch_move_lru(). We know that a non-lru page may be not charged to memcg. > But is it possible for a non-lru page to be passed to folio_batch_move_lru()? Seems > impossible. Right? I am not very confident about this commit, hopefully, someone can > review it. How about to temporarily drop it? I was about to suggest it anyway during the review: it's a standalone optimization and the main patchset is already quite big and complex, so probably easier to validate it separately. Thanks!