Received: by 10.223.164.202 with SMTP id h10csp150199wrb; Mon, 13 Nov 2017 22:11:35 -0800 (PST) X-Google-Smtp-Source: AGs4zMaUeLv9gPF6VF2vBnX4R0g3E3vD0mYDBJa6Yrv30YCmIgRvyvDCiVdOciOUzlYqpKxpIbaj X-Received: by 10.84.128.36 with SMTP id 33mr7119739pla.329.1510639894906; Mon, 13 Nov 2017 22:11:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510639894; cv=none; d=google.com; s=arc-20160816; b=TyPNnavoOJveMSfxT4kncMJ91/bNpcf7mpknCclwI9mqiov/wKvx7/SMGvxJUOW//1 NbKCOVRdufW1hvV/Wl/elTXRZhrueCLeT9/Uz3KBh+wxYGMo/P7AZmq8mMUC/GnIPhLQ nrJfyTr0wmK+/3TgYE2l6hhd6aRKlIEIR2Y9aWcJ5LdfyISjfW9s2T5Z0X+FLyZjJZ8S UHppqm2g+sqpks5nvNDLmzlhNK1N4Zezz3OHw2nJyYwFEAfTFPTH7TcnUfYHT8QDAaAo J8q9g0bTYmHY5NvXzXJe9yO6c539F7ye8ef9dlkaOKYzXMHv0Bv56ua4QoVbGW97hPZe QG2A== 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=WxfCJDqhxhKaAYFWTg7U0yGzfnpYk8UbYUrVSk4gjwk=; b=giBOtTmtivBNYLUulNkdZIZlyyPRtxNlCzpXbf09ZBB7YRIMUby1rhRipY7902kX7L DvqH3nwCQiiyhY5ZDOun12S2beJjqv/72hMAMju1ZF5IHbBj1ESX/IK/5lU+0n61hwMd oF/Ht2JexlvDAKoHG11G3nN0b2JQpiBvZRuWIuFJ5SfyxO18gf9TpsAniGVfw0f1H6Pb pkzFTJZt1X64OV1AWrzLfqlMRuKDy+9CpFtnVmCdLkv7R4iPmF0S5z38LmYMN6n8H8Hl YDs4uh2ks3OTgxKCbi5RZN8x4nSDpBXnnJFYmCoxZxh666B1us2L6rDuQmobA5zK6TME aB6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=WBK6bxj5; 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 t12si14792628pgc.603.2017.11.13.22.11.13; Mon, 13 Nov 2017 22:11:34 -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=WBK6bxj5; 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 S1753302AbdKNGKL (ORCPT + 89 others); Tue, 14 Nov 2017 01:10:11 -0500 Received: from mail-eopbgr50045.outbound.protection.outlook.com ([40.107.5.45]:11711 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750790AbdKNGKE (ORCPT ); Tue, 14 Nov 2017 01:10:04 -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=WxfCJDqhxhKaAYFWTg7U0yGzfnpYk8UbYUrVSk4gjwk=; b=WBK6bxj5o47BEq/1UTku20bjGjC6Gv4YynoKuDqAe3PPLPF1cQ4B5jONRrLAZRIVezwi5YXscjv4O3k8XEdNwuI054rgUyRhpT1RtQmmsL7fd0pzBO5/yAze0emkMtAkIs6AlQj2vvkt2fxD3rRIpo1Ek1qttmJCruEdGU5Yw5o= Received: from AM3PR04MB1489.eurprd04.prod.outlook.com (10.163.186.23) by AM3PR04MB514.eurprd04.prod.outlook.com (10.242.111.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.12; Tue, 14 Nov 2017 06:10:00 +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; Tue, 14 Nov 2017 06:10:00 +0000 From: Ran Wang To: Michal Hocko CC: "linux-mm@kvack.org" , 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: AdNcTdwxuwkeiWHpRfKAuFheVJAmNgAADAHAAAg2wwAAJ/aMQA== Date: Tue, 14 Nov 2017 06:10:00 +0000 Message-ID: References: <20171113110232.ivd6l52y7j2q2iaq@dhcp22.suse.cz> In-Reply-To: <20171113110232.ivd6l52y7j2q2iaq@dhcp22.suse.cz> 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: [199.59.231.64] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AM3PR04MB514;6:I9LJEzBD5IVRaZ2FdNCl+QjLpczVrbpJ/WxzccU7RthBa5j7cuSQmSLR3zqIPjVTJus3nPgt2W3VNm+2+Yjo0mU5/xyuZe4metNsqMFiE/b17OYywkngTPckEXakXZYmaNUPQKAib1WBgZ+Yaz031qPC9KNTB7ajkGLkALctEAJFH8h/mzcSDS5a3mkmqoqy8KUF3+wHvyDGVnx3cFk1XWgCnThN5MaxsARNtkmqnF/VGsKqSQrnxMIGWk0hfqZpyHV4uFluFF78XhHh6Kj5gWIXz4rH7HEav8BnkqDwUWTE3MZS51Xw8RYMWsnjNoWaD5J5qV9hFcGcQeIlKb/2YJkr8SLFpSscERDcnzOnFMs=;5:IkApt6TBSCk+gDlaAybGR4tNa1yuNmKx9d5K6lpEKTqTFHEtpxbZ004Lj8ul7wiALaQHv7DfhYv/ADawPWPGz/nNi9CKqRN5wDhcSKN6EgAyQGsTXquMCcs06FGuwc7lo8W3GYlkkV1cDYep9AqXKuqzi7ANIbnSptTBpXCt+GY=;24:r664Okr1pWMFJcKrygOp/jV1bDhfNuceThXYu+8J7r9lIXit3mJZJBerS+NlL9gba1be5Zv9vl9lqMrKL0T63nm0/ivJ74/qoEHBtKyd3Ag=;7:uwKO2R8VFUyFmpdo1HGTD7M6hC7tehVwRur8m443AtgM9GSlGMqQQ7X+7bP2l4NvyYKOJVqnCevndRds7I7oQJ8nCyGDAst5SfyMDLwJyQJ73iGqTiXfsfqsKEb7FT88nBIgVsIu0ZJaKlF3liCZjOJCahiBDPO8G5w03Uj9TkCPYNeis/faR2OUMxxp/amE4roiIIG5x3v/+kv+MsnAO8kuD4hgYqTE1CnRGMIByK2l47Jt4TDS7aTEjeYZRLNI x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(376002)(346002)(24454002)(189002)(199003)(377424004)(13464003)(66066001)(2950100002)(8936002)(25786009)(6916009)(7696004)(3660700001)(6246003)(81156014)(106356001)(4326008)(81166006)(3846002)(33656002)(105586002)(189998001)(102836003)(6116002)(316002)(2900100001)(3280700002)(2906002)(50986999)(54906003)(39060400002)(8676002)(101416001)(76176999)(54356999)(74316002)(305945005)(9686003)(53546010)(5250100002)(55016002)(86362001)(6436002)(478600001)(6306002)(6506006)(45080400002)(575784001)(7736002)(229853002)(966005)(99286004)(53936002)(5660300001)(97736004)(68736007)(7416002)(14454004);DIR:OUT;SFP:1101;SCL:1;SRVR:AM3PR04MB514;H:AM3PR04MB1489.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-ms-office365-filtering-correlation-id: 537322c9-b6a3-48b3-54fe-08d52b265668 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199);SRVR:AM3PR04MB514; x-ms-traffictypediagnostic: AM3PR04MB514: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(209352067349851)(9452136761055)(189930954265078)(50582790962513)(170618885588394)(45079756050767)(104084551191319)(185117386973197); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(3231022)(3002001)(10201501046)(6055026)(6041248)(20161123558100)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:AM3PR04MB514;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:AM3PR04MB514; x-forefront-prvs: 04916EA04C 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: 537322c9-b6a3-48b3-54fe-08d52b265668 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Nov 2017 06:10:00.0285 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR04MB514 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michal, > -----Original Message----- > From: Michal Hocko [mailto:mhocko@kernel.org] > Sent: Monday, November 13, 2017 7:03 PM > To: Ran Wang > Cc: linux-mm@kvack.org; 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 >=20 > On Mon 13-11-17 07:33:13, Ran Wang wrote: > > 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) =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, assign= ed > bus number 1 > > [ 2.710949] cma: cma_alloc: alloc failed, req-size: 1 pages, ret: -1= 6 > > [ 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? >=20 > Yes. It should be in linux-next. Have a look at the following email > thread: > https://emea01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Flkml. > kernel.org%2Fr%2F20171104082500.qvzbb2kw4suo6cgy%40dhcp22.suse.cz& > data=3D02%7C01%7Cran.wang_1%40nxp.com%7C5e73c6a941fc4f1c10e708d52 > a860c5b%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636461677 > 583607877&sdata=3DzlRxJ4LZwOBsit5qRx9yFT5qfP54wZ0z6G1z%2Bcywf5g%3D > &reserved=3D0 Thanks for your info, although I fail to open the link you shared, but I go= t patch from my colleague and the issue got fix on my side, let you know, thanks. Best Regards, Ran > -- > Michal Hocko > SUSE Labs From 1583948523152200801@xxx Mon Nov 13 11:03:45 +0000 2017 X-GM-THRID: 1583264906851375953 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread