Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2193631rdb; Tue, 3 Oct 2023 13:12:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTbJamDhBwzLz9IgNpnskmU3tZcV9mXv6remto20Hq64PcM8PwaFncw6BHVDeXz/JKZh+Z X-Received: by 2002:a05:6a21:191:b0:160:18d6:a3d7 with SMTP id le17-20020a056a21019100b0016018d6a3d7mr717634pzb.1.1696363972257; Tue, 03 Oct 2023 13:12:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696363972; cv=none; d=google.com; s=arc-20160816; b=CJLt0VUhgoOeJ6XA5HKDfgMC1eq+Bk9MjyAaG6Ul3QRwg/ZZ3yDR9GgaIHetwQZqxC Xnj0Rt0i+kXnGG5AE/ElO8k1yiTGzc927H0XSzYatW6BRKBENzOExlSJACWX/Z8vTuwg mdJZtLyDyJegSfeETSYfzF3nTNrDrhv9vjwx9L3hm3PrGUv+aztIVqtiD4BR3yAV9s3c 6C1rZ8ZTVdvsAdPbTCqiy2FrKd524j216eFK6zARPYwN9GjTVDRZfhgzL2P1LxzQT3Rq MDFxaidmSfRLmSa4pynVZSQJBsQc80K3MGu6GM4MW5XFRUTySdMEN9T62TZPfPjtv1ro GY9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=pxSZGmmjNVXQJSnzeq0G7a7BTzv04odKA1GngTIRTAo=; fh=n5ojMQC9pVxcSKxqZ8kCihc/WQZoeM1xBhW1zfxgQN8=; b=U4IkGgZS6qZu/J5KbP9pN56GI5odbpY8hP54guFef1Sdd1k7IPZ3DNOroTWjGkld/r lmKNG+uCz4ULNua3mQSyPrghTzuGDKe/GGhQqV8TsML53lsDkJXBkro7Ib8Qxrg1+Acj /ouEPVbE/ffXAowgW/W/QdqjHNXwPNzHwIJww201vxrY0EfK9cgGxqqYguSJNo0vgDfU OTyhBSaaPXwddGOo/Eg19+GwUxCQnyx4oRVQ2nZLm4VuhyJ7l6R5O42MUoYsenCId7FH 8S91OsOveMgXFNJQ+unIazoKEDLe6TIXcdSaSSJj9SfQ2Zm4/VZHvU69l4tVc9A2rxdV 06VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=b7wJT2lQ; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=mOLmS3Ey; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alu.unizg.hr Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id u69-20020a637948000000b005893b7094easi1541133pgc.554.2023.10.03.13.12.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 13:12:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=b7wJT2lQ; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=mOLmS3Ey; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alu.unizg.hr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 23FC481A99AA; Tue, 3 Oct 2023 13:12:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241026AbjJCUMn (ORCPT + 99 others); Tue, 3 Oct 2023 16:12:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231806AbjJCUMm (ORCPT ); Tue, 3 Oct 2023 16:12:42 -0400 Received: from domac.alu.hr (domac.alu.unizg.hr [161.53.235.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9F5C9E for ; Tue, 3 Oct 2023 13:12:36 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by domac.alu.hr (Postfix) with ESMTP id 37B5360173; Tue, 3 Oct 2023 22:12:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1696363954; bh=3amMaq29morJQRBmN64tOmRcaqhD62RaH1xvx+cR1e0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=b7wJT2lQaOePEHifofzZV4vw7ihkuu9WfSDvCIfMaTAHwyaAP1yZvEuJQYwrdr0EV S4324oclvyMrQ+HMr8g8wDXW++BMOymZoTu4Cj865Q6J3tsEGCZKtnDWoaWwd5CzE6 AQkUAaFiqWKtabtiZFaS4oZ2OiPdcF5FAGMUemqAw0vTMtdSa3Vg+nWDx4WslAX23q Jc8/wv6nrpugFYDP7OWVyoMk/jroBqZvRVLoOpMbAAVZNu7OkCLiA0CqBWeOUyVVXJ ZFM2Qq7ycfzYYrEWOd4kAVFs0dNS3Q4pb05oKlTF9rY8DD0CUklHxe2vNawHT1snjH HCtfeVIa9XxnA== X-Virus-Scanned: Debian amavisd-new at domac.alu.hr Received: from domac.alu.hr ([127.0.0.1]) by localhost (domac.alu.hr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hTZSUGvs4RVA; Tue, 3 Oct 2023 22:12:32 +0200 (CEST) Received: from [192.168.1.6] (78-3-40-17.adsl.net.t-com.hr [78.3.40.17]) by domac.alu.hr (Postfix) with ESMTPSA id 9D98F6016E; Tue, 3 Oct 2023 22:12:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1696363952; bh=3amMaq29morJQRBmN64tOmRcaqhD62RaH1xvx+cR1e0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=mOLmS3EywplYJ7mYRpFqCh3womwAu8/RGYwouma+OP4IVjJIss7Ug5n1WqZDjQuIB pEcBfv6PDsWEXF2/7eku6xfABnSgkxxeVPXbVrxxgv+w7j1xcu2deIOI+dax/tGbSr IYkfGO8jrv4SB9oaf3Gg1/M6cnLOim98N+dUnDPqmRJlKIPLRzvB0V8bGo0qakCLpK Sq/pEtpa6hdgKamh4K+1ZHai7LPLIH37twRn6JZZ/YWDZKftKzaV+UpbWpASuYdWJ8 ucnagf4Pwfbb1rJxF6c+TRoPeB8PW4D/UE8im0n8o+fwphF/N+rT28DG+o6UNb1/gl flLSLXJhycC5g== Message-ID: Date: Tue, 3 Oct 2023 22:12:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG: KCSAN: data-race in folio_batch_move_lru / mpage_read_end_io Content-Language: en-US To: Matthew Wilcox Cc: linux-kernel@vger.kernel.org, Andrew Morton , linux-mm@kvack.org, Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org References: <22a42774-ebe1-081a-c9b9-e11f4d74bc3a@alu.unizg.hr> From: Mirsad Todorovac In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 03 Oct 2023 13:12:50 -0700 (PDT) On 9/18/23 16:53, Matthew Wilcox wrote: > On Mon, Sep 18, 2023 at 02:15:05PM +0200, Mirsad Todorovac wrote: >>> This is what I'm currently running with, and it doesn't trigger. >>> I'd expect it to if we were going to hit the KCSAN bug. >>> >>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c >>> index 0c5be12f9336..d22e8798c326 100644 >>> --- a/mm/page_alloc.c >>> +++ b/mm/page_alloc.c >>> @@ -4439,6 +4439,7 @@ struct page *__alloc_pages(gfp_t gfp, unsigned int order, int preferred_nid, >>> page = __alloc_pages_slowpath(alloc_gfp, order, &ac); >>> out: >>> + VM_BUG_ON_PAGE(page && (page->flags & (PAGE_FLAGS_CHECK_AT_PREP &~ (1 << PG_head))), page); >>> if (memcg_kmem_online() && (gfp & __GFP_ACCOUNT) && page && >>> unlikely(__memcg_kmem_charge_page(page, gfp, order) != 0)) { >>> __free_pages(page, order); >> >> Hi, >> >> Caught another instance of this bug involving folio_batch_move_lru: I don't seem that I can make it >> happen reliably by the nature of the data racing conditions if I understood them well. > > Were you running with this patch at the time, or was this actually > vanilla? The problem is that, if my diagnosis is correct, both of the > tasks mentioned are victims; we have a prematurely freed page. While > btrfs is clearly a user, it may not be btrfs's fault that the > page was also allocated as an anon page. > > I'm trying to gather more data, and running with this patch will give > us more -- because it'll dump the entire struct page instead of just > the page->flags, like KCSAN is currently doing. As my learning curve adapts, I seem to be more aware of what you are talking about. I still have to learn to cope with patches, diffs, fixes and pulls all together and consistent. Sometimes I feel like in the BORG maturation chamber when I try to learn the Linux kernel, and I wonder if this is the Author of my story trying to make up "for the years that locust had eaten". Or is it that I am just losing the plot. I learn that I was conceited and not respecting the work you guys have done in thirty years I wasted for one reason or another: objective difficulties and personal weaknesses. Forgive me this moment of truth. I certainly feel more motivated to catch the real culprit, rather than just the symptoms. I will rebuild with your patch again and try to reproduce the problem. Best regards Mirsad Todorovac