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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE49AC00140 for ; Wed, 10 Aug 2022 16:27:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2CA066B0071; Wed, 10 Aug 2022 12:27:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 252D48E0003; Wed, 10 Aug 2022 12:27:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0CCB08E0002; Wed, 10 Aug 2022 12:27:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id F0A4B6B0071 for ; Wed, 10 Aug 2022 12:27:36 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id BAD25161451 for ; Wed, 10 Aug 2022 16:27:36 +0000 (UTC) X-FDA: 79784213712.14.30D20E5 Received: from outbound-smtp63.blacknight.com (outbound-smtp63.blacknight.com [46.22.136.252]) by imf13.hostedemail.com (Postfix) with ESMTP id 257522006D for ; Wed, 10 Aug 2022 16:27:34 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp63.blacknight.com (Postfix) with ESMTPS id 6C2CEFA908 for ; Wed, 10 Aug 2022 17:27:33 +0100 (IST) Received: (qmail 27831 invoked from network); 10 Aug 2022 16:27:33 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.198.246]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 10 Aug 2022 16:27:33 -0000 Date: Wed, 10 Aug 2022 17:27:25 +0100 From: Mel Gorman To: Vlastimil Babka Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, William Kucharski , David Hildenbrand Subject: Re: [PATCH v2 15/16] slab: Allocate frozen pages Message-ID: <20220810162725.jhe4j3ai4enxpqx3@techsingularity.net> References: <20220809171854.3725722-1-willy@infradead.org> <20220809171854.3725722-16-willy@infradead.org> <40a4a2d9-0029-2cb9-2d35-6329d5969292@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <40a4a2d9-0029-2cb9-2d35-6329d5969292@suse.cz> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660148855; a=rsa-sha256; cv=none; b=QEu29aXXDWRxLuRh03Q7akrtffkxcGHFoAufF3ZRm3LSAmiGZEtrjj0V5Jtn6nmYY7lczl ykge3DD5QCCUvGXMWNXbQ90jjduXAAzCSPTg8U5cg2F5vf0PBq/xce2kNE/GPv+FqiPQqo gg9dIGwjtdNx43twf/hxtxnhIkjAjiQ= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf13.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.136.252 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660148855; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dr+lPG2PnNC/t52btqKXRZjYjQKpElcX8zlH3kLI0+k=; b=w0I+3KEyrjSUP0Pz7H9Hv30WthkHe4KIbwa8t9vpyKVp6YEgTBJj+a2I1har6yJZ2ZSts9 LB0Zjq8i5lpuVyq1XGdDtG2jK9/fbfThXP5nlZWp7nJj3T4L47VlSVxgdBjZMkXXoinoA3 T+xKLYaBsX2UdRUgdl4VvUHjHIQKDQA= X-Rspam-User: X-Stat-Signature: nck5caowganyob3okr3968c3e3e9m8eh X-Rspamd-Queue-Id: 257522006D Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf13.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.136.252 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-Rspamd-Server: rspam01 X-HE-Tag: 1660148854-927767 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 Wed, Aug 10, 2022 at 02:31:11PM +0200, Vlastimil Babka wrote: > On 8/9/22 19:18, Matthew Wilcox (Oracle) wrote: > > Since slab does not use the page refcount, it can allocate and > > free frozen pages, saving one atomic operation per free. > > > > Signed-off-by: Matthew Wilcox (Oracle) > > Reviewed-by: William Kucharski > > AFAICS the problem of has_unmovable_pages() is not addressed: > https://lore.kernel.org/all/40d658da-6220-e05e-ba0b-d95c82f6bfb3@redhat.com/ > > But I don't think it's sustainable approach to enhance the checks there with > PageSlab() and then with whatever other user will adopt allocating frozen > pages in the future. I guess it would be better to just be able to detect > pages on pcplist without false positives. A new page type? Maybe the > overhead of managing it would be negligible as we set page->index anyway for > migratetype? > I think page type would be usable to identify a PCP page same as how it's used to identify a buddy page. Most likely, this could be done in check_pcp_refill, check_new_pcp (watch DEBUG_VM) and free_pcppages_bulk. There would be a race between the last refcount being dropped and becoming a PCP page but I doubt that matters to page isolation as I expect it retries. The __Clear and __Set operations would add some overhead but it's almost certainly cheaper than the put_page_testzero in __free_pages(). -- Mel Gorman SUSE Labs