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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 AB2E8C4363D for ; Tue, 22 Sep 2020 14:36:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 98C1B20739 for ; Tue, 22 Sep 2020 14:36:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="S1ylR72K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 98C1B20739 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 10FC490008E; Tue, 22 Sep 2020 10:36:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C1CB900086; Tue, 22 Sep 2020 10:36:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F408590008E; Tue, 22 Sep 2020 10:36:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id DD119900086 for ; Tue, 22 Sep 2020 10:36:06 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A342C181AC9C6 for ; Tue, 22 Sep 2020 14:36:06 +0000 (UTC) X-FDA: 77290947132.09.oven89_2913f002714e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 73630180AD804 for ; Tue, 22 Sep 2020 14:36:06 +0000 (UTC) X-HE-Tag: oven89_2913f002714e X-Filterd-Recvd-Size: 2480 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Sep 2020 14:36:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=u3YeIXCT+AG4vi1F0coTjYeWDIv5hXBb8Fo6mRGjaEQ=; b=S1ylR72KAde9/JozVWndgysyCo zrOd6tCZswcFuJIwKAu89x4A8JIBKHl98dBDgJyYg2rf8T5eoW26aLR/ZdxUu7jPGiDrZHDZ6YBYk lLY1HgX6sDbwJ+QZmrTh4JKOvcWp7jjqE7giQLRsEl1Aeitc0pf+Eyk3h7QTYa/dlt+Six5R6RI63 KvZGYOhoDm/prGFwcJxMtEkPI+llcUIdMIYvEqp0A2FBS2rcFpuiszeuKBYGarEwXIJCF5DLD0sks xW4wKVqlEs3CaW2600c28KwpWr0gvE3r92zdwzeSfGwCJaJ8DJ7wkzkrXFSV7ejDBK/eK9uQtAqrQ JOSJMqnA==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKjOh-0000kW-QN; Tue, 22 Sep 2020 14:35:59 +0000 Date: Tue, 22 Sep 2020 15:35:59 +0100 From: Matthew Wilcox To: Andrew Morton Cc: Nick Piggin , Hugh Dickins , Peter Zijlstra , Daisuke Nishimura , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] page_alloc: Fix freeing non-compound pages Message-ID: <20200922143559.GF32101@casper.infradead.org> References: <20200922140017.26387-1-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200922140017.26387-1-willy@infradead.org> 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: On Tue, Sep 22, 2020 at 03:00:17PM +0100, Matthew Wilcox (Oracle) wrote: > void __free_pages(struct page *page, unsigned int order) > { > if (put_page_testzero(page)) > free_the_page(page, order); > + else > + while (order-- > 0) > + free_the_page(page + (1 << order), order); > } > EXPORT_SYMBOL(__free_pages); ... a three line patch and one of them is wrong. - else + else if (!PageHead(page)) Anyone got a smart idea about how to _test_ this code path? I'm wondering about loading one kernel module which wanders through memmap calling if (page_cache_get_speculative(page)) put_page(page); and another kernel module that calls __free_pages(alloc_page(GFP_KERNEL, 1), 1); and putting in a printk to let me know when we hit it.