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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=no 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 6E844C433E0 for ; Fri, 10 Jul 2020 07:01:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D0BF7206A5 for ; Fri, 10 Jul 2020 07:01:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0BF7206A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5E75B6B0005; Fri, 10 Jul 2020 03:01:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 597EB6B000A; Fri, 10 Jul 2020 03:01:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 486E46B000C; Fri, 10 Jul 2020 03:01:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id 30DC96B0005 for ; Fri, 10 Jul 2020 03:01:28 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A4EA48248D7C for ; Fri, 10 Jul 2020 07:01:27 +0000 (UTC) X-FDA: 77021270214.27.balls44_270fe4c26ecc Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 7DB723D66D for ; Fri, 10 Jul 2020 07:01:27 +0000 (UTC) X-HE-Tag: balls44_270fe4c26ecc X-Filterd-Recvd-Size: 2566 Received: from out30-44.freemail.mail.aliyun.com (out30-44.freemail.mail.aliyun.com [115.124.30.44]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Fri, 10 Jul 2020 07:01:25 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0U2GmRJK_1594364477; Received: from IT-FVFX43SYHV2H.local(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0U2GmRJK_1594364477) by smtp.aliyun-inc.com(127.0.0.1); Fri, 10 Jul 2020 15:01:18 +0800 Subject: Re: a question of split_huge_page To: =?UTF-8?Q?Mika_Penttil=c3=a4?= , "Kirill A. Shutemov" , Matthew Wilcox Cc: Johannes Weiner , Linux-MM , "linux-kernel@vger.kernel.org" , Hugh Dickins References: <20200709155002.GF12769@casper.infradead.org> <20200709160750.utl46xvavceuvnom@box> <441ebbeb-0408-e22e-20f4-1be571c4a18e@nextfour.com> From: Alex Shi Message-ID: Date: Fri, 10 Jul 2020 15:00:40 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <441ebbeb-0408-e22e-20f4-1be571c4a18e@nextfour.com> Content-Type: text/plain; charset=utf-8 X-Rspamd-Queue-Id: 7DB723D66D X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 Content-Transfer-Encoding: quoted-printable 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: =E5=9C=A8 2020/7/10 =E4=B8=8B=E5=8D=881:28, Mika Penttil=C3=A4 =E5=86=99=E9= =81=93: >> Thanks a lot for quick reply! >> What I am confusing is the call chain: __iommu_dma_alloc_pages() >> to split_huge_page(), in the func, splited page, >> page =3D alloc_pages_node(nid, alloc_flags, order); >> And if the pages were added into lru, they maybe reclaimed and lost, >> that would be a panic bug. But in fact, this never happened for long t= ime. >> Also I put a BUG() at the line, it's nevre triggered in ltp, and run_v= mtests >=20 > In=C2=A0 __iommu_dma_alloc_pages, after split_huge_page(),=C2=A0 who is= taking a > reference on tail pages? Seems tail pages are freed and the function > errornously returns them in pages[] array for use? >=20 Why you say so? It looks like the tail page returned and be used pages =3D __iommu_dma_alloc_pages() in iommu_dma_alloc_remap() and still on node's lru. Is this right? thanks!