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=-6.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 44A66C07E96 for ; Thu, 8 Jul 2021 17:05:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2450D61626 for ; Thu, 8 Jul 2021 17:05:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229662AbhGHRIj (ORCPT ); Thu, 8 Jul 2021 13:08:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbhGHRIj (ORCPT ); Thu, 8 Jul 2021 13:08:39 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F6F8C061574 for ; Thu, 8 Jul 2021 10:05:57 -0700 (PDT) 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ...