Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1308700pxx; Fri, 30 Oct 2020 07:12:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxj42KSogK1J55iqeT+x6lR7zYcUkWNGyEolJy9nDK0tRARnmqB4r530k9062ckMCADAv+n X-Received: by 2002:a17:906:7210:: with SMTP id m16mr2807229ejk.490.1604067157327; Fri, 30 Oct 2020 07:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604067157; cv=none; d=google.com; s=arc-20160816; b=SCLbz+uN43lW4DqSzYXKrlu2zrGqo/q347xM/Tn4l06dxTM9ZxCnQsSpROiDAkZ6zk iKGY5p3Be5/82bH4Lw4orrrrJodkkDwpbyFKWqdZfmIa1v04Ltkz/6JvD0GyafMCacJ6 BznNVLWrTACMlDyXhkbM1he5P/VJi/mGZIKZ1DTJTTNk1OIGmUxUO0HSM920Mw/dQe7x 1/M/+sRyyXc0tjSooOhJFxOEWvlAhcfGDnWA3A6XE7ZQ+Z+AsEz3w9b2Gcmf9HR+PHKA u+kKnCkejY3nBjxzuFWNqxOBWq8uu6FIs7mJSdib+JjATSwfj7DMx1XJ48BukbcKVCfB 2njw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=oE7zJnELOj3JSr2Ymb2+NJIOFKcpsBSnN86Rkhl8axs=; b=qkKXc7481CwVUyVmnfcyqwmS0AtzAahNOciGR4g1u9c4SqRCQGDFZ3TpTSvBJyBzGa 3L/Yc8yjLCyYeQ/lfeDpcn06Jxtf8XE/hC4MjA2zk5J5tsBTSPLDxhnAGyDvWUCnHO9+ ESKhFnnTHKNGrwFXFFqWjkX2MQjRJsdx4hMDvzdSFHtMPIV8HjdrZ8KDI5Pkkz5Nj0ro VnLcfXXtt872uXCM1qEQRiaXcYVZu2sBAt4VpgyhtnashDcMQDgVk/6WDy70yt6HF8R7 yKaxI3G8LnwSJgMJesHF54AnDEOwN+8MMbFi0EUscHYvBJXZwAAgq7+WesQr3FfBWz+o k82g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OorXOklm; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x14si3725495ejs.714.2020.10.30.07.12.12; Fri, 30 Oct 2020 07:12:37 -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=@redhat.com header.s=mimecast20190719 header.b=OorXOklm; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726645AbgJ3OKc (ORCPT + 99 others); Fri, 30 Oct 2020 10:10:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40199 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726101AbgJ3OKb (ORCPT ); Fri, 30 Oct 2020 10:10:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604067029; 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=oE7zJnELOj3JSr2Ymb2+NJIOFKcpsBSnN86Rkhl8axs=; b=OorXOklm+xoyx3z3G6aTPyW6vywT119EPPvga/WPSnOeEqFi/5qMYTBguD0AXXUNoUOkMf 0QVlGsJlTRxk8eE+uq6Y6rRa+JHH0w7Qx9Zs4wirUFNttgRm1pB90IkuTn+M1vOjQBuMvE HnKSseRyyU+zDbDgXBj+wwGN5LP7u3g= Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-187-Vc2t_TQrPPCRy2sQWCuJow-1; Fri, 30 Oct 2020 10:10:27 -0400 X-MC-Unique: Vc2t_TQrPPCRy2sQWCuJow-1 Received: by mail-pl1-f198.google.com with SMTP id bb2so4593428plb.8 for ; Fri, 30 Oct 2020 07:10:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=oE7zJnELOj3JSr2Ymb2+NJIOFKcpsBSnN86Rkhl8axs=; b=MV0ngNtA3UHDwh6dQ/yDLztcpa2zJZss+dD2PGQv6H0pg16T0DWDMF/xxonzkngRAR Q+wtCBlJlnKUciZI6PrFeJqiiwhBbEQFxtN9Usk7Hfg7OIh3swH8evd5GN2qX0BuCnED 0a0Zn1wCzTAFIVbeNsvR4p2Cw5abm7z4uP/ut/lD5UpTkZ2EabdWLDSgY3IKGLYAgG2d PIDQZjzyMP4x5zjPhjJuh9+e3Pvx3/bHrhY2/i8MCr/fI9hUXmIi8aMmgmUR+XHGmwcP agF17qWirRsspXS+he/TS+mKH0Ph1G+ieWaixY9dSZxyKbmS+wXRlNa+ru2KF/a+OYXo 9sfA== X-Gm-Message-State: AOAM5322epxwVDbSdUTYfDkbUEupHbDFjlQuBnvOh3WzRCh2TN/SQVvJ 3TM/YJAhdXZ7WzhrFDatWtH8kN8uGW0AdHfy8FViu4owEvd6VtwRxDBb72qO7ReQUzdfSPHgusj LRRJCpdurytr49VwrwBG7bq8z X-Received: by 2002:a17:902:6b84:b029:d5:ef85:1a79 with SMTP id p4-20020a1709026b84b02900d5ef851a79mr9345447plk.32.1604067026849; Fri, 30 Oct 2020 07:10:26 -0700 (PDT) X-Received: by 2002:a17:902:6b84:b029:d5:ef85:1a79 with SMTP id p4-20020a1709026b84b02900d5ef851a79mr9345377plk.32.1604067025973; Fri, 30 Oct 2020 07:10:25 -0700 (PDT) Received: from xiangao.remote.csb ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id mz23sm3376896pjb.3.2020.10.30.07.10.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2020 07:10:25 -0700 (PDT) Date: Fri, 30 Oct 2020 22:10:15 +0800 From: Gao Xiang To: Vladimir Zapolskiy Cc: linux-erofs@lists.ozlabs.org, Gao Xiang , stable@vger.kernel.org, LKML Subject: Re: [PATCH 1/4] erofs: fix setting up pcluster for temporary pages Message-ID: <20201030141015.GC133455@xiangao.remote.csb> References: <20201022145724.27284-1-hsiangkao.ref@aol.com> <20201022145724.27284-1-hsiangkao@aol.com> <20201030124745.GB133455@xiangao.remote.csb> <02427b81-7854-1d97-662f-ab2d2b868514@tuxera.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <02427b81-7854-1d97-662f-ab2d2b868514@tuxera.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 30, 2020 at 03:32:55PM +0200, Vladimir Zapolskiy wrote: > Hi Gao Xiang, > > On 10/30/20 2:47 PM, Gao Xiang wrote: > > Hi Vladimir, > > > > On Fri, Oct 30, 2020 at 02:20:31PM +0200, Vladimir Zapolskiy wrote: > > > Hello Gao Xiang, > > > > > > On 10/22/20 5:57 PM, Gao Xiang via Linux-erofs wrote: > > > > From: Gao Xiang > > > > > > > > pcluster should be only set up for all managed pages instead of > > > > temporary pages. Since it currently uses page->mapping to identify, > > > > the impact is minor for now. > > > > > > > > Fixes: 5ddcee1f3a1c ("erofs: get rid of __stagingpage_alloc helper") > > > > Cc: # 5.5+ > > > > Signed-off-by: Gao Xiang > > > > > > I was looking exactly at this problem recently, my change is one-to-one > > > to your fix, thus I can provide a tag: > > > > > > Tested-by: Vladimir Zapolskiy > > > > Many thanks for confirming this! > > I found this when I was killing magical stagingpage page->mapping, > > it's somewhat late :-) > > > > sure, for me it was an exciting immersion into the filesystem code :) Thanks for your effort on this! You could also post related kernel message in advance and I will definitly look into that as well. :) > > > > > > > > > > The fixed problem is minor, but the kernel log becomes polluted, if > > > a page allocation debug option is enabled: > > > > > > % md5sum ~/erofs/testfile > > > BUG: Bad page state in process kworker/u9:0 pfn:687de > > > page:0000000057b8bcb4 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x687de > > > flags: 0x4000000000002000(private) > > > raw: 4000000000002000 dead000000000100 dead000000000122 0000000000000000 > > > raw: 0000000000000000 ffff888066758690 00000000ffffffff 0000000000000000 > > > page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set > > > Modules linked in: > > > CPU: 1 PID: 602 Comm: kworker/u9:0 Not tainted 5.9.1 #2 > > > Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014 > > > Workqueue: erofs_unzipd z_erofs_decompressqueue_work > > > Call Trace: > > > dump_stack+0x84/0xba > > > bad_page.cold+0xac/0xb1 > > > check_free_page_bad+0xb0/0xc0 > > > free_pcp_prepare+0x2c8/0x2d0 > > > free_unref_page+0x18/0xf0 > > > put_pages_list+0x11a/0x120 > > > z_erofs_decompressqueue_work+0xc9/0x110 > > > ? z_erofs_decompress_pcluster.isra.0+0xf10/0xf10 > > > ? read_word_at_a_time+0x12/0x20 > > > ? strscpy+0xc7/0x1a0 > > > process_one_work+0x30c/0x730 > > > worker_thread+0x91/0x640 > > > ? __kasan_check_read+0x11/0x20 > > > ? rescuer_thread+0x8a0/0x8a0 > > > kthread+0x1dd/0x200 > > > ? kthread_unpark+0xa0/0xa0 > > > ret_from_fork+0x1f/0x30 > > > Disabling lock debugging due to kernel taint > > > > Yeah, I can make a pull-request to Linus if you need this to be in master > > now, or I can post it for v5.11-rc1 since 5.4 LTS isn't effected (and it > > would be only a print problem with debugging option.) > > > > As for myself I don't utterly need this fix on the master branch ASAP, however > it might be reasonable to get it included right into the next v5.10 release, > because I believe it'll be an LTS. Eventually it's up to you to make a decision, > from my side I won't urge you, the fixed issue is obviously a non-critical one. > > Thank you for the original fix and taking my opinion into consideration :) Yeah, v5.10 is a LTS version, and you are right, I will try to make a pull-request after I get Chao's RVB. Thanks, Gao Xiang > > -- > Best wishes, > Vladimir >