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=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 CED47C433E3 for ; Wed, 26 Aug 2020 00:43:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8F5E620782 for ; Wed, 26 Aug 2020 00:43:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="OxYZSN59" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F5E620782 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3929C6B0006; Tue, 25 Aug 2020 20:43:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3437D6B0007; Tue, 25 Aug 2020 20:43:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 259E76B0008; Tue, 25 Aug 2020 20:43:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id 0E31D6B0006 for ; Tue, 25 Aug 2020 20:43:00 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id CF47C181AEF1E for ; Wed, 26 Aug 2020 00:42:59 +0000 (UTC) X-FDA: 77190870078.24.value07_35082ef27060 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 9FC831A4A0 for ; Wed, 26 Aug 2020 00:42:59 +0000 (UTC) X-HE-Tag: value07_35082ef27060 X-Filterd-Recvd-Size: 2801 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf16.hostedemail.com (Postfix) with ESMTP for ; Wed, 26 Aug 2020 00:42:59 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0049A2074A; Wed, 26 Aug 2020 00:42:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598402578; bh=GQlLj22PHNu4N2tC0wyjXvzJ8I9QqXfye6YxJQk0AoI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OxYZSN59BtoftXpHxY2VztXYGvH7IvTYtN7mbBPS/DtafZaujOxpL7Tk5uQSKIuc3 gZsUpzoMJhC3HvsUMPwoZu3veTLFPErcRXGX3asPMRUK22zZEx/lPNQfrklr/ek5Fr bax8IkLeW5HbCKNyrxIK+QndxGbWYdXHimqKbgqo= Date: Tue, 25 Aug 2020 17:42:57 -0700 From: Andrew Morton To: Joonsoo Kim Cc: Linux Memory Management List , LKML , Michal Hocko , Vlastimil Babka , "Aneesh Kumar K . V" , kernel-team@lge.com, Joonsoo Kim Subject: Re: [PATCH for v5.9] mm/page_alloc: handle a missing case for memalloc_nocma_{save/restore} APIs Message-Id: <20200825174257.5b48a5dd24b5e08a915b101e@linux-foundation.org> In-Reply-To: References: <1598331582-19923-1-git-send-email-iamjoonsoo.kim@lge.com> <20200824221049.edb3c540bbfc859a6806600d@linux-foundation.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 9FC831A4A0 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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, 25 Aug 2020 14:34:32 +0900 Joonsoo Kim wrote: > > > > That's a bunch more code on a very hot path to serve an obscure feature > > which has a single obscure callsite. > > > > Can we instead put the burden on that callsite rather than upon > > everyone? For (dumb) example, teach __gup_longterm_locked() to put the > > page back if it's CMA and go get another one? > > Hmm... Unfortunately, it cannot ensure that we eventually get the non-CMA page. > I think that the only way to ensure it is to implement the > functionality here. We can > use 'unlikely' or 'static branch' to reduce the overhead for a really > rare case but > for now I have no idea how to completely remove the overhead. Gee, there must be something? Provide the gup code with a special entry point which takes the page straight from __rmqueue() and bypasses the pcp lists?