Received: by 10.223.164.202 with SMTP id h10csp2973516wrb; Sun, 12 Nov 2017 23:34:06 -0800 (PST) X-Google-Smtp-Source: AGs4zMbpe1ci9eTj7Hf3gi1VX2iejA/mXQ2dZ4WymnNsdxS46p7hMarBWKKkXzYWEhe7jGCdNMjR X-Received: by 10.101.75.141 with SMTP id t13mr7840783pgq.122.1510558445902; Sun, 12 Nov 2017 23:34:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510558445; cv=none; d=google.com; s=arc-20160816; b=te3tldoKe8Hmz5cJl+bztO5uHcyDqIMBTOVGwmRSxhGo2wc2npViekdbA65OVgW1LS e6KjoQcn0zc/t0+Qk9EDi+d1tY3kdpkFCVJc/U54S/3WQz+BVl2WEsCmRZZyOhigt+mi BviBNEBbpxHlJr7kckSI1yTBjJ96lwCkWB+tDHYZMOFHeDSGOc5lBtZGW19ap3YNrTTD k/xNOSSjhVNCl9hyEmC1TF2ffb2eJ3qAoy163ADoZKVdz924MaE//2DFFiZQpPNszH46 rbSJa+TUMkGnvVqb2erMyt7hMX6pb9f89iUIv3YwAPcxV4xHkZqu27mSuL9NHVQC/dyL J6/g== 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 :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=2hgNfKl5j0vmaEZBItNhChrzwZ9HNsAU+VI2df9GEsc=; b=cBTw1MkyLB6zG/lf0asVlnyT6JfzzDTq8TRU/4jJfkKiBvAoDb4YAvAvryt/FD+Duz dGr4qhWyN67hzHczsd/2QQRObMTlDsvIfGF5ztZuJQEnY9HqmhtaKBNUxSfC+GrHUnyU JGYbRFMoQ0LqiGp+sS7tT1/d+ZaP7ZxWbCKJH3ixK2pd4IIqiHEkkBUsu28EBd7poPox UTXADQ8sOyC7DbIO0rdAp27SLT7Gsld38xYrk/4ZITroTfg+ILq+bTlswgDrtn25HC2O TI/88y26vtGa2ZJB4ioqpq+6kT+iOaL4GmaDY6QVUicySZb2FizrfFp8hg/5tDsCmukz cH7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=as6Ucxpd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k189si7986788pgc.133.2017.11.12.23.33.53; Sun, 12 Nov 2017 23:34:05 -0800 (PST) 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; dkim=pass header.i=@nxp.com header.s=selector1 header.b=as6Ucxpd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751978AbdKMHdT (ORCPT + 89 others); 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=2hgNfKl5j0vmaEZBItNhChrzwZ9HNsAU+VI2df9GEsc=; b=as6Ucxpd1PksAo2JrGhbRRaBzjIrTz3IutvCSh18YoHhloQCjUFafpz3ntWh98MEq1QqIIM5KIdNtG6vQyg1zMmYf4JBLXa8pGRYccYLkzBD0jYge/rdHDISPzlOzD4W4U8diDl5v7eLRMH2fEJaHU0epM+OI5OjUmjqUCuByJg= Received: from AM3PR04MB1489.eurprd04.prod.outlook.com (10.163.186.23) by AM3PR04MB516.eurprd04.prod.outlook.com (10.242.112.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.12; Mon, 13 Nov 2017 07:33:14 +0000 Received: from AM3PR04MB1489.eurprd04.prod.outlook.com ([fe80::6134:4e3f:86e:10b8]) by AM3PR04MB1489.eurprd04.prod.outlook.com ([fe80::6134:4e3f:86e:10b8%13]) with mapi id 15.20.0218.015; Mon, 13 Nov 2017 07:33:13 +0000 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 received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Michal, > Date: Fri, 13 Oct 2017 14:00:12 +0200 >=20 > From: Michal Hocko >=20 > Michael has noticed that the memory offline tries to migrate kernel code > pages when doing echo 0 > /sys/devices/system/memory/memory0/online >=20 > The current implementation will fail the operation after several failed p= age > 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. >=20 > The real problem is in has_unmovable_pages in fact. We should fail if the= re > 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. >=20 > 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(-) >=20 > 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) =3D=3D ZONE_MOVABLE) > return false; > - mt =3D get_pageblock_migratetype(page); > - if (mt =3D=3D 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 b= us 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 recen= tly, so do you have the solution now? Best regards Ran >=20 > pfn =3D page_to_pfn(page); > for (found =3D 0, iter =3D 0; iter < pageblock_nr_pages; iter++) { From 1583305876165779819@xxx Mon Nov 06 08:49:09 +0000 2017 X-GM-THRID: 1583264906851375953 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread