From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_RED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22458C433ED for ; Thu, 20 May 2021 05:13:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3B92611AE for ; Thu, 20 May 2021 05:13:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230354AbhETFPE (ORCPT ); Thu, 20 May 2021 01:15:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbhETFPD (ORCPT ); Thu, 20 May 2021 01:15:03 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A68B7C061574 for ; Wed, 19 May 2021 22:13:42 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id m190so11029332pga.2 for ; Wed, 19 May 2021 22:13:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KaaO+rgq7za+Bh8Mhm+Si3DDC8n5bDNTzJDoNGn9P2E=; b=qV4r0Jx+ks1W5hhnGC7jyO5rmXFsKRY4Pgr1mWgOKRw1DzOB6TnhK4cO8H9YulwoJp scVEvxyMoKcCwMDZ73f6dENYbgrwcoFbwxWdFCViAmFErYHPTnI5494i/7mwrv7Py5uo 5qBnKBnALrOJK1MYSBjJyTjedIjVHOSRHye0goYVAm2p/tSSeoXIAcgcU5qhA/CSuCsP FdRX1aqycFNbDs57ELfhvgTpbZp31CguhPLfPhzXJjsvi7C6AiRse45Nu5PbFN7kDOUT sJidtSnKt2/ju5HY5VrHL67+gB+hdXB8vNAQmYKEfTuYYwofiEWcSof+XwKU4zuAQf3N raLw== 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=KaaO+rgq7za+Bh8Mhm+Si3DDC8n5bDNTzJDoNGn9P2E=; b=TUMY9bACMTDeD4mWM1i+uC1vGvWcEGK39V0DSVDKbdfrynN4+2bNXgQEqQTmaaV2KW pRRqo/oShEViW23AjMVyNq8HBWjdoe/5ky34IWTgsc6BeJ31xtdYgSD7dqJL93JiTN2k jRWfJuIMtZvw+lGYTBfD3A7xclS3V/eFvz1Lry7n/enUnLOPHpQH9OsyizqHub3CiBCJ /GeXfCcAES7QzH9zebtcb0bs5wfeJtjzgGGkze5qXMbZDl2c8IJDldye+fUGOaSlOg6I KCTi0NjgzunecSO96DF88s0FP3cHi9gsBDtqBGVxHFBNEmbmrg6MvMJmdGZsnuIcaQEQ TTLg== X-Gm-Message-State: AOAM5335EMmydEXMh7rMo39OhmmgDzzPXPOzMjBlD6PIf+0wpmi56HgO octAASMwbdq6XdiyhzIU4jlGG2Whq2zJY+ITY8uxGQ== X-Google-Smtp-Source: ABdhPJzOHTOmxl+VFUBauY9/0vq0OrnBaQUC1Sr+Oh0R3kHarioCsMUpiIKAF0Mxi7BBfX5ogHaw6+GY9NYaiRwT30A= X-Received: by 2002:a65:5288:: with SMTP id y8mr2747587pgp.31.1621487622186; Wed, 19 May 2021 22:13:42 -0700 (PDT) MIME-Version: 1.0 References: <20210520025949.1866-1-songmuchun@bytedance.com> <20210519212412.5653163f94904b141d5d74ce@linux-foundation.org> In-Reply-To: <20210519212412.5653163f94904b141d5d74ce@linux-foundation.org> From: Muchun Song Date: Thu, 20 May 2021 13:13:05 +0800 Message-ID: Subject: Re: [External] Re: [PATCH] mm: migrate: fix missing update page_private to hugetlb_page_subpool To: Andrew Morton Cc: Oscar Salvador , Mike Kravetz , Michal Hocko , David Hildenbrand , Matthew Wilcox , Linux Memory Management List , LKML , Xiongchun duan , zhengqi.arch@bytedance.com, fam.zheng@bytedance.com, Anshuman Khandual Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 20, 2021 at 12:24 PM Andrew Morton wrote: > > On Thu, 20 May 2021 10:59:49 +0800 Muchun Song wrote: > > > Since commit d6995da31122 ("hugetlb: use page.private for hugetlb specific > > page flags") converts page.private for hugetlb specific page flags. We > > should use hugetlb_page_subpool() to get the subpool pointer instead of > > page_private(). The commit forgot to update it in the page migration > > routine. So fix it. > > > > ... > > > > --- a/mm/migrate.c > > +++ b/mm/migrate.c > > @@ -1290,7 +1290,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page, > > * page_mapping() set, hugetlbfs specific move page routine will not > > * be called and we could leak usage counts for subpools. > > */ > > - if (page_private(hpage) && !page_mapping(hpage)) { > > + if (hugetlb_page_subpool(hpage) && !page_mapping(hpage)) { > > rc = -EBUSY; > > goto out_unlock; > > } > > So it uses the wrong page*, so this isn't just a cosmetic fix. One > cannot tell from this changelog. > > Please describe the runtime effects of this bug. Please always include > this information when fixing bugs. And when adding them. OK. I should update the commit log in the next version. Thanks. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_RED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 235F2C433ED for ; Thu, 20 May 2021 05:13:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7E8AA611AD for ; Thu, 20 May 2021 05:13:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E8AA611AD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A17A96B006C; Thu, 20 May 2021 01:13:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 99ED66B006E; Thu, 20 May 2021 01:13:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 819026B0070; Thu, 20 May 2021 01:13:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 4A18B6B006C for ; Thu, 20 May 2021 01:13:46 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id BB059181AF5CA for ; Thu, 20 May 2021 05:13:45 +0000 (UTC) X-FDA: 78160442010.11.0C17A4E Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by imf19.hostedemail.com (Postfix) with ESMTP id EF63990009E8 for ; Thu, 20 May 2021 05:13:41 +0000 (UTC) Received: by mail-pg1-f179.google.com with SMTP id j12so11019612pgh.7 for ; Wed, 19 May 2021 22:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KaaO+rgq7za+Bh8Mhm+Si3DDC8n5bDNTzJDoNGn9P2E=; b=qV4r0Jx+ks1W5hhnGC7jyO5rmXFsKRY4Pgr1mWgOKRw1DzOB6TnhK4cO8H9YulwoJp scVEvxyMoKcCwMDZ73f6dENYbgrwcoFbwxWdFCViAmFErYHPTnI5494i/7mwrv7Py5uo 5qBnKBnALrOJK1MYSBjJyTjedIjVHOSRHye0goYVAm2p/tSSeoXIAcgcU5qhA/CSuCsP FdRX1aqycFNbDs57ELfhvgTpbZp31CguhPLfPhzXJjsvi7C6AiRse45Nu5PbFN7kDOUT sJidtSnKt2/ju5HY5VrHL67+gB+hdXB8vNAQmYKEfTuYYwofiEWcSof+XwKU4zuAQf3N raLw== 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=KaaO+rgq7za+Bh8Mhm+Si3DDC8n5bDNTzJDoNGn9P2E=; b=s5ajUc/t3ETukAyb0sVBtee74imgtpXEcyj9jhaxNnW64bmutLmw/RvYLqfExwssPa dps5GWA8xpxzP0aP9Dharwy2B5IcI68p7TVSXUeXKQ6HyzQaAXCH9SW3kRwU7NcayHk5 zqcjsHzYMi0zosIrw8YNyXTYdvY2M5/7djVZzzr59WSy6VbilHFEg2ANC+DRJnFxoj2T t5UR+S8Ca9LiOvzgJmo+6kqtCC6Q6zIPaSc4t41MLBYhMkNXQ2gE1KGoe5KwDrQ72d/2 GkumdcJX317vDzvY3pI4xQr+oeWXqwgLT1zxIqcav7icsfkSqkTvkIT3aHWfd9YI8XnV qVKQ== X-Gm-Message-State: AOAM533RzToQCEkUmfC8eui6hiCrK2OsULe9C7kicSnHrQbbLx4Oh/DD eH9wUO9LfsHE7SfR5YR5DXQA/ljwCV0VbxCtl4nIig== X-Google-Smtp-Source: ABdhPJzOHTOmxl+VFUBauY9/0vq0OrnBaQUC1Sr+Oh0R3kHarioCsMUpiIKAF0Mxi7BBfX5ogHaw6+GY9NYaiRwT30A= X-Received: by 2002:a65:5288:: with SMTP id y8mr2747587pgp.31.1621487622186; Wed, 19 May 2021 22:13:42 -0700 (PDT) MIME-Version: 1.0 References: <20210520025949.1866-1-songmuchun@bytedance.com> <20210519212412.5653163f94904b141d5d74ce@linux-foundation.org> In-Reply-To: <20210519212412.5653163f94904b141d5d74ce@linux-foundation.org> From: Muchun Song Date: Thu, 20 May 2021 13:13:05 +0800 Message-ID: Subject: Re: [External] Re: [PATCH] mm: migrate: fix missing update page_private to hugetlb_page_subpool To: Andrew Morton Cc: Oscar Salvador , Mike Kravetz , Michal Hocko , David Hildenbrand , Matthew Wilcox , Linux Memory Management List , LKML , Xiongchun duan , zhengqi.arch@bytedance.com, fam.zheng@bytedance.com, Anshuman Khandual Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=qV4r0Jx+; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf19.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.215.179 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: EF63990009E8 X-Stat-Signature: a5ffx8z8bepdh81ycxoge4xz4eqhe7mz X-HE-Tag: 1621487621-621420 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, May 20, 2021 at 12:24 PM Andrew Morton wrote: > > On Thu, 20 May 2021 10:59:49 +0800 Muchun Song wrote: > > > Since commit d6995da31122 ("hugetlb: use page.private for hugetlb specific > > page flags") converts page.private for hugetlb specific page flags. We > > should use hugetlb_page_subpool() to get the subpool pointer instead of > > page_private(). The commit forgot to update it in the page migration > > routine. So fix it. > > > > ... > > > > --- a/mm/migrate.c > > +++ b/mm/migrate.c > > @@ -1290,7 +1290,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page, > > * page_mapping() set, hugetlbfs specific move page routine will not > > * be called and we could leak usage counts for subpools. > > */ > > - if (page_private(hpage) && !page_mapping(hpage)) { > > + if (hugetlb_page_subpool(hpage) && !page_mapping(hpage)) { > > rc = -EBUSY; > > goto out_unlock; > > } > > So it uses the wrong page*, so this isn't just a cosmetic fix. One > cannot tell from this changelog. > > Please describe the runtime effects of this bug. Please always include > this information when fixing bugs. And when adding them. OK. I should update the commit log in the next version. Thanks.