From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751982AbdKMHdT (ORCPT ); Mon, 13 Nov 2017 02:33:19 -0500 Received: from mail-eopbgr10056.outbound.protection.outlook.com ([40.107.1.56]:45592 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751583AbdKMHdS (ORCPT ); Mon, 13 Nov 2017 02:33:18 -0500 From: Ran Wang To: "linux-mm@kvack.org" , Michal Hocko CC: Michael Ellerman , Vlastimil Babka , Andrew Morton , KAMEZAWA Hiroyuki , Reza Arbab , Yasuaki Ishimatsu , "qiuxishi@huawei.com" , Igor Mammedov , Vitaly Kuznetsov , LKML , Leo Li , Xiaobo Xie Subject: RE: [PATCH 1/2] mm: drop migrate type checks from has_unmovable_pages Thread-Topic: [PATCH 1/2] mm: drop migrate type checks from has_unmovable_pages Thread-Index: AdNcTdwxuwkeiWHpRfKAuFheVJAmNgAADAHA Date: Mon, 13 Nov 2017 07:33:13 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=ran.wang_1@nxp.com; x-originating-ip: [192.158.241.86] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AM3PR04MB516;6:XGe0UUw29SrhF+lEm3ClIDGGgQdtnFxd1ttBrMrJBtq1QqWEtlFyZOpjzoEr/QpFJIsRPo4W5se93/Z3YmrV0lt9eNpJn5ZWIzp0M47Gcuqulx3pDnPy9x9DjAXdi25+l3a+YAEZ1y5KlDGA4wOr58ejBTtz11yNSxY82vROpqLIAbhInmJFJhSp2cZrN4J1xEI2hsFqWbwoAjqQWxXjOKt6lO7DH2tQKMCF8NvI6oknNG9bo/h/DMdVWYiKoGAy32QF7u5Ha1g0hJ2ZxylGClgnAMp5BAoV9W7enNXFQ/dWLQR/UYQBDc+tzV2KrBiYlABUlb257p9YwqbQ9GYiF0xRsufO9h7O9YCOMZTHRK0=;5:CFE9tLka8Acq2B7D0ZMKPmVKyAjfcESCkQ/IVWEGrPe0zUo+mNWMtD3utfCYj1n/yJDhqwhgSSUmLGPIx3CYrFqsmLoZn9MxsWXBKxrfGyoRZ+ZUphPbn7FTUl7kjWi01cW4gQYkrC8TPSGx/7u2Eaynv+KLItPxOJrwLlCQajM=;24:xeiGk6UgS0cm5IG7cS7dVpETccCKOqvypLmDyPJZ7kXxqI+3ohkuF/zmN+1GIzdvNufNbfHfLZpYfrNO02SlZrwYCp0wHr5ZNtO3HEnMK0Y=;7:UMgnXT6J8+zY1e71082C1PZM/4ITWPmRjC1LSLW3QlKiWu9EOGmjSEM7AFyHIahod6llyBfY3kvZ7pQnwR1YYsf1HcW96Jv0PpKhJYE15dfh7DKQVkzWkCL3xlUL6Z9VRY/gqFG/acKdcfmZNS/hXPaqrLt3ArPn8NoQH0dMvNt7j6K/yhjsriVx9jvhk7JetsnWRhrQB0VaRCRJKxRy+itqJcD93Eg0Om1PqdRSj+wUqT0TFxiObKHTHQBumADA x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10009020)(6009001)(346002)(39860400002)(376002)(199003)(189002)(305945005)(102836003)(50986999)(105586002)(2900100001)(6246003)(7736002)(2940100002)(3846002)(3280700002)(39060400002)(25786009)(101416001)(2501003)(478600001)(6116002)(5250100002)(3660700001)(55016002)(14454004)(4326008)(189998001)(106356001)(54356999)(76176999)(2906002)(74316002)(2950100002)(9686003)(7416002)(54906003)(33656002)(6436002)(99286004)(316002)(6506006)(97736004)(68736007)(53936002)(7696004)(229853002)(8676002)(81166006)(81156014)(66066001)(5660300001)(110136005)(8936002)(86362001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM3PR04MB516;H:AM3PR04MB1489.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; x-ms-office365-filtering-correlation-id: 4775c4f9-6744-4638-40e2-08d52a68cc2f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199);SRVR:AM3PR04MB516; x-ms-traffictypediagnostic: AM3PR04MB516: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(209352067349851); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231022)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(20161123562025)(20161123560025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:AM3PR04MB516;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:AM3PR04MB516; x-forefront-prvs: 0490BBA1F0 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4775c4f9-6744-4638-40e2-08d52a68cc2f X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Nov 2017 07:33:13.2157 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR04MB516 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id vAD7XOF8002269 Hello Michal, > Date: Fri, 13 Oct 2017 14:00:12 +0200 > > From: Michal Hocko > > Michael has noticed that the memory offline tries to migrate kernel code > pages when doing echo 0 > /sys/devices/system/memory/memory0/online > > The current implementation will fail the operation after several failed page > migration attempts but we shouldn't even attempt to migrate that memory > and fail right away because this memory is clearly not migrateable. This will > become a real problem when we drop the retry loop counter resp. timeout. > > The real problem is in has_unmovable_pages in fact. We should fail if there > are any non migrateable pages in the area. In orther to guarantee that > remove the migrate type checks because MIGRATE_MOVABLE is not > guaranteed to contain only migrateable pages. It is merely a heuristic. > Similarly MIGRATE_CMA does guarantee that the page allocator doesn't > allocate any non-migrateable pages from the block but CMA allocations > themselves are unlikely to migrateable. Therefore remove both checks. > > Reported-by: Michael Ellerman > Signed-off-by: Michal Hocko > Tested-by: Michael Ellerman > Acked-by: Vlastimil Babka > --- > mm/page_alloc.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c index > 3badcedf96a7..ad0294ab3e4f 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -7355,9 +7355,6 @@ bool has_unmovable_pages(struct zone *zone, > struct page *page, int count, > */ > if (zone_idx(zone) == ZONE_MOVABLE) > return false; > - mt = get_pageblock_migratetype(page); > - if (mt == MIGRATE_MOVABLE || is_migrate_cma(mt)) > - return false; This drop cause DWC3 USB controller fail on initialization with Layerscaper processors (such as LS1043A) as below: [ 2.701437] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1 [ 2.710949] cma: cma_alloc: alloc failed, req-size: 1 pages, ret: -16 [ 2.717411] xhci-hcd xhci-hcd.0.auto: can't setup: -12 [ 2.727940] xhci-hcd xhci-hcd.0.auto: USB bus 1 deregistered [ 2.733607] xhci-hcd: probe of xhci-hcd.0.auto failed with error -12 [ 2.739978] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller And I notice that someone also reported to you that DWC2 got affected recently, so do you have the solution now? Best regards Ran > > pfn = page_to_pfn(page); > for (found = 0, iter = 0; iter < pageblock_nr_pages; iter++) {