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.8 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 F3B83C07E96 for ; Thu, 8 Jul 2021 17:12:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8173F61626 for ; Thu, 8 Jul 2021 17:12:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8173F61626 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 566556B0072; Thu, 8 Jul 2021 13:12:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5144D6B0078; Thu, 8 Jul 2021 13:12:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 38FBD6B007E; Thu, 8 Jul 2021 13:12:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0050.hostedemail.com [216.40.44.50]) by kanga.kvack.org (Postfix) with ESMTP id F357A6B0072 for ; Thu, 8 Jul 2021 13:12:28 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4675F18451420 for ; Thu, 8 Jul 2021 17:12:28 +0000 (UTC) X-FDA: 78340064376.30.B36080F Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf16.hostedemail.com (Postfix) with ESMTP id 094EDF018D1E for ; Thu, 8 Jul 2021 17:05:49 +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=3fx3PknPwALzsgoH1BEN/LFvMNGd9Ult799sX+NQQtw=; b=ewNur+WRDTeCU1XmdHtflzT0wV BqTeEy3EhFKg1dnvnfooIBavr8RUDn3TLbL5etUV5VednLO7QODNyRteMI/Wp16CEHxARoWJHVKLe UQI3+ESuZjRuSlIbD5X+Aeyr4E9PTs2coRXnevJ/t1+VyNMGH30nMW4i0I+80SEOBQ3Q4s9FXRZA1 h63kI1ofm68YL5xyjTUoyz6O9Dh5LTmmU6hinmg1sOffSJ6Kof1upMqfAnYlgrqVKbUsZ4nNoGlZM n8WK9px4nrQ+IIcYEp2s0ebhvZF6lqE+B3DlrPM7od9jcIxvkSLd0ii0yOvqGcfTor4RqEU8xBTvS oMLe0knQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m1XSq-00DfW0-R8; Thu, 08 Jul 2021 17:05:31 +0000 Date: Thu, 8 Jul 2021 18:05:28 +0100 From: Matthew Wilcox To: Rafael Aquini Cc: Mel Gorman , Andrew Morton , linux-mm@kvack.org, Desmond Cheong Zhi Xi , linux-kernel@vger.kernel.org, skhan@linuxfoundation.org, Zqiang , linux-kernel-mentees@lists.linuxfoundation.org, syzbot+127fd7828d6eeb611703@syzkaller.appspotmail.com Subject: Re: [PATCH] mm/page_alloc: Avoid page allocator recursion with pagesets.lock held Message-ID: References: <20210708081434.GV3840@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 094EDF018D1E Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=ewNur+WR; spf=none (imf16.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Stat-Signature: yopfat6qhnrahcrprojifrxd9jphs5oj X-HE-Tag: 1625763949-793727 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 Thu, Jul 08, 2021 at 09:10:18AM -0400, Rafael Aquini wrote: > > There are a number of ways it could be fixed. The page owner code could > > be audited to strip GFP flags that allow sleeping but it'll impair the > > functionality of PAGE_OWNER if allocations fail. The bulk allocator > > could add a special case to release/reacquire the lock for prep_new_page > > and lookup PCP after the lock is reacquired at the cost of performance. > > The patches requiring prep could be tracked using the least significant If we're nitpicking changelogs, then s/patches/pages/ > > bit and looping through the array although it is more complicated for > > the list interface. The options are relatively complex and the second > > one still incurs a performance penalty when PAGE_OWNER is active so this > > patch takes the simple approach -- disable bulk allocation of PAGE_OWNER is > ^^^^ > Minor nit: s/of/if > > > active. The caller will be forced to allocate one page at a time incurring > > a performance penalty but PAGE_OWNER is already a performance penalty. The thought occurs that all pages allocated this way will have the same stack. Someone suitably motivated could: - Refcount the stacks managed by page_owner - Generate the stack in the caller of alloc_bulk - Pass the stack in to a new __set_page_owner() That's a lot of work; I'm not going to do it, and I don't think Mel should either. But if someone's looking for something to do ...