Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp623014pxv; Thu, 8 Jul 2021 10:07:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyXMIJfWgib8/WXdRDyxfCJOca3NeApkL8ZMMnXaXxX5W7tY4tk5mUq6x/eTqcX5eBe0wR X-Received: by 2002:a17:906:24c3:: with SMTP id f3mr19763787ejb.145.1625764029861; Thu, 08 Jul 2021 10:07:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625764029; cv=none; d=google.com; s=arc-20160816; b=x1jOXaQ9giuUCjprmCJZv0WMMIg4x3eZBvVV07zr9dodZa6bArWz3ritLEzSTQnj6v 9YRy+dJzkziNPOLrVm4d93sTHbTU2qicSituGM/wU9QEVF89/0Zwx1oXabdEaFK07tQA WYJa+r5ohEn0Pe+teuy/jhs9CRyL+UiZPCVGw91w6J+fg9+HnmuY28UsVZXtKVBFaZtH jEqyMjZagKXKekR8QLcK9MI7aoI+tXbJrMKFVHZ8cxJE0Omv5ZxTK2wrVgsHE9J1YS3t A3pQYfXiP6tJ/5TKCVuf6Z4GJdWXnpJfnS3QumsF/yKwGPVKNmBe06kJMj8gwJ/LizV/ AeIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3fx3PknPwALzsgoH1BEN/LFvMNGd9Ult799sX+NQQtw=; b=YQ4KiwDWkHxkY3lGPd6TKMn/aXCxxv0iKn46EYsNa9R6memzQhkq0TYiBaGoqBgbgm aJcL599JKguJqa/8472/v1uTM/pAzP7Y0krLma8lolrVa3SD7sA/Z8T8Ld2FRqeAE5Su ygTeWa0VqwvLyS8N5kRe+dmm6NirevPfv/ABOUtoKsq8qf+AMsCT6o84dVui5RUo0DJ1 FIO4NbDfENHxf2Gihp9bL/P+Nc5hXsN3rwmPi+pAcp6JZjYxNKILlRjl8FgAO06Anj24 n2GXaq1KZCRL5QWFWsg8+nJB0jrN5G/OvpGNT6fIFSTA8PDaiCUh9WmFWUhREWoy+oeK yxKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ewNur+WR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb21si3822900ejc.42.2021.07.08.10.06.45; Thu, 08 Jul 2021 10:07:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ewNur+WR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229566AbhGHRIj (ORCPT + 99 others); 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 ...