Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp620204ybe; Wed, 4 Sep 2019 05:20:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWUbpdc6iqjUqOadZxWB8n34Df9UCypl7accr+RM65MXScQ0xPOHdR0oTkUKJQxBh8q1UF X-Received: by 2002:aa7:870c:: with SMTP id b12mr7210630pfo.122.1567599630250; Wed, 04 Sep 2019 05:20:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567599630; cv=none; d=google.com; s=arc-20160816; b=my30QZmVYqKp1xRzob5d53hGXZ7w3nV/j1YIG2uqGLKJptiKlSDJBnJ5JY3rrFfDgO WotQnQBTJ2j5E2fdYUJFlU8EHw4XL1kJxEniAav9ScqyDqkykElHsAppkoVUSvt6xh9s m3XX86rWuwPGft1N/RXYooenbfSrNvckCEPmGUI0/wMrkx46iCfv0S81DyOHTV2V5q2H vq8LUi9dZYGrrRuV/o+bH75uNSwRcrAaOgVY8vRYCPcqWHOZzznxEYRzTmsoBw7s82Pk d4RWWNIRir5SSFMysQMCrPRprqRGT3gasD1lD+F0OIe/uluh3r01foVAIMYEKQHAQetf xwBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=Rw7OyiE84ULIoFvznvDzIy64cPtnGtwrcW3vLN3QaKc=; b=pc25VggZzHQdSTu7Gy3oteho+m57W1JTLekzG/a//CLUDVtr/WsRj/EFe1RH636k80 8MrPIBEuIjqmTVR5qvVRSlj4TxyojXxxlEgdmrAbFhrqF72NBFFz7IHAxTcWxMhSbJqW P+wOPZ0MPoIpOKNy0WVI9KImUboG/rOmIVfNOmGD51eyZIhyLGm1F0zV3hxzhRGKqkyP Jq0rAyPbttPK6Aj0L2ExBHWs4bToZ6xs8izAyw2VtzhoyMGyVfeLRfJLkHb3G30IzMJB UrysyYv6/nHzCwCRcq11zno1FEKnsXYMd/LwfVg8TLt0BYRcia/NGQoqqDo7ZpWokDk3 KnQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g21si17532871pgk.293.2019.09.04.05.20.13; Wed, 04 Sep 2019 05:20:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729973AbfIDMTS convert rfc822-to-8bit (ORCPT + 99 others); Wed, 4 Sep 2019 08:19:18 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:37294 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727929AbfIDMTS (ORCPT ); Wed, 4 Sep 2019 08:19:18 -0400 Received: from DGGEML401-HUB.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id 409C5B175537DB1266F5; Wed, 4 Sep 2019 20:19:16 +0800 (CST) Received: from DGGEML512-MBX.china.huawei.com ([169.254.2.60]) by DGGEML401-HUB.china.huawei.com ([fe80::89ed:853e:30a9:2a79%31]) with mapi id 14.03.0439.000; Wed, 4 Sep 2019 20:19:11 +0800 From: sunqiuyang To: Michal Hocko CC: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" Subject: RE: [PATCH 1/1] mm/migrate: fix list corruption in migration of non-LRU movable pages Thread-Topic: [PATCH 1/1] mm/migrate: fix list corruption in migration of non-LRU movable pages Thread-Index: AQHVYi7CKRiSaGuZ20KJAhdeZXNZ4qcZaW+AgAFf/lT//8LbAIAAjGWd//+OTACAAMgqDg== Date: Wed, 4 Sep 2019 12:19:11 +0000 Message-ID: <157FC541501A9C4C862B2F16FFE316DC190C3402@dggeml512-mbx.china.huawei.com> References: <20190903082746.20736-1-sunqiuyang@huawei.com> <20190903131737.GB18939@dhcp22.suse.cz> <157FC541501A9C4C862B2F16FFE316DC190C1B09@dggeml512-mbx.china.huawei.com> <20190904063836.GD3838@dhcp22.suse.cz> <157FC541501A9C4C862B2F16FFE316DC190C2EBD@dggeml512-mbx.china.huawei.com>,<20190904081408.GF3838@dhcp22.suse.cz> In-Reply-To: <20190904081408.GF3838@dhcp22.suse.cz> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.177.249.127] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ________________________________________ From: Michal Hocko [mhocko@kernel.org] Sent: Wednesday, September 04, 2019 16:14 To: sunqiuyang Cc: linux-kernel@vger.kernel.org; linux-mm@kvack.org Subject: Re: [PATCH 1/1] mm/migrate: fix list corruption in migration of non-LRU movable pages Do not top post please On Wed 04-09-19 07:27:25, sunqiuyang wrote: > isolate_migratepages_block() from another thread may try to isolate the page again: > > for (; low_pfn < end_pfn; low_pfn++) { > /* ... */ > page = pfn_to_page(low_pfn); > /* ... */ > if (!PageLRU(page)) { > if (unlikely(__PageMovable(page)) && !PageIsolated(page)) { > /* ... */ > if (!isolate_movable_page(page, isolate_mode)) > goto isolate_success; > /*... */ > isolate_success: > list_add(&page->lru, &cc->migratepages); > > And this page will be added to another list. > Or, do you see any reason that the page cannot go through this path? The page shouldn't be __PageMovable after the migration is done. All the state should have been transfered to the new page IIUC. ---- I don't see where page->mapping is modified after the migration is done. Actually, the last comment in move_to_new_page() says, "Anonymous and movable page->mapping will be cleard by free_pages_prepare so don't reset it here for keeping the type to work PageAnon, for example. " Or did I miss something? Thanks, -- Michal Hocko SUSE Labs