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.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 DEC96C433DF for ; Wed, 26 Aug 2020 05:21:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9BFE42078D for ; Wed, 26 Aug 2020 05:21:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ErlMU/Ke" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BFE42078D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3038C6B0003; Wed, 26 Aug 2020 01:21:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 28F4C6B0005; Wed, 26 Aug 2020 01:21:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 155F56B0006; Wed, 26 Aug 2020 01:21:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0005.hostedemail.com [216.40.44.5]) by kanga.kvack.org (Postfix) with ESMTP id F051E6B0003 for ; Wed, 26 Aug 2020 01:21:56 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A6953249F for ; Wed, 26 Aug 2020 05:21:56 +0000 (UTC) X-FDA: 77191573032.29.end55_131832f27061 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 7715518086CCF for ; Wed, 26 Aug 2020 05:21:56 +0000 (UTC) X-HE-Tag: end55_131832f27061 X-Filterd-Recvd-Size: 4587 Received: from mail-qv1-f65.google.com (mail-qv1-f65.google.com [209.85.219.65]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Wed, 26 Aug 2020 05:21:55 +0000 (UTC) Received: by mail-qv1-f65.google.com with SMTP id dd12so253860qvb.0 for ; Tue, 25 Aug 2020 22:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=js0EBC62eWGyWAw9YJWIyLBqx2ojH0IgaEQrWHEIoXI=; b=ErlMU/KeJReMDDWNhlUIRGySVmy3ZbFLthcDLUwgpSWt8bgf6Y+3A+gXACc3aSugat uVPawmSTv1QFEVkBmYXMoMvv8ZzBiUT8eWET69xlh8dOPXS+WxYELokjxMqn2d9BQ90L iaC0+khrDU6LMOcUv4Xvg6AThTYLNBlAqbPYybxt9ikwIFLiQV3seXYwEwuo/KZTaf/f 8fDErVlBkYsJDK1GSU2opAeCL7ChvFpQBDxYKJNq6gfNgyXhW+16CCPIi6y2WDmz9fsr pzHKd3lyT2fHNoTiyISi1CRm5wOdgayb9SalsfWtZ0GBiOUBFiPb1prQLtGffhqUHcL4 trRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=js0EBC62eWGyWAw9YJWIyLBqx2ojH0IgaEQrWHEIoXI=; b=QS3ayAYeoXjYWf8sfDB60LXXmMeXfrd/8T6CGswANn6IBvQXGeB6Oxzx4+mRmvOEzL X07WLHfB72DJIQ+VnUChkNGZkPCRPeJdoynkBpf765DA2nwl3K39J+KcdohBs9fnlzMX EvY1h1diX/C1TyfDXk5aX33QrsnOm6rMXlIqyH+2NMRu+XuOD4L/Lcm3wP6lCQDsnQAO 85nDlrmfHhdzIf6XwZH6m5tant/Up98MLjp7Bol+3if+MkMPFsXzaJHv+3heIVIiN374 aXTVMsi+la95YklR4aLQIzFjh2oTGY2ouChVtb8lNef9MiAzkE7N741LjM6O0pKCTHn9 3ySg== X-Gm-Message-State: AOAM530HTxrG1/4CLljcCouD5S32JVyWkxmEucPLBFpLR3MN4MHhZ8kl uB71J8zKbeQS2LujyWibD1AScy+gd3AUzLWGVLI= X-Google-Smtp-Source: ABdhPJx+R64pJw48sxesha5UFmsvqWxbki3DIAa8ABi4VpfdPgoyGpwdHW/9IAVPPWzez5itZdMXGCnOPCuwpIlmN+I= X-Received: by 2002:a05:6214:68b:: with SMTP id r11mr12451619qvz.226.1598419315432; Tue, 25 Aug 2020 22:21:55 -0700 (PDT) MIME-Version: 1.0 References: <1598331582-19923-1-git-send-email-iamjoonsoo.kim@lge.com> <20200824221049.edb3c540bbfc859a6806600d@linux-foundation.org> <20200825174257.5b48a5dd24b5e08a915b101e@linux-foundation.org> In-Reply-To: <20200825174257.5b48a5dd24b5e08a915b101e@linux-foundation.org> From: Joonsoo Kim Date: Wed, 26 Aug 2020 14:21:44 +0900 Message-ID: Subject: Re: [PATCH for v5.9] mm/page_alloc: handle a missing case for memalloc_nocma_{save/restore} APIs To: Andrew Morton Cc: Linux Memory Management List , LKML , Michal Hocko , Vlastimil Babka , "Aneesh Kumar K . V" , kernel-team@lge.com, Joonsoo Kim Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 7715518086CCF X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: 2020=EB=85=84 8=EC=9B=94 26=EC=9D=BC (=EC=88=98) =EC=98=A4=EC=A0=84 9:42, A= ndrew Morton =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84= =B1: > > 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 featu= re > > > 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 t= he > > > page back if it's CMA and go get another one? > > > > Hmm... Unfortunately, it cannot ensure that we eventually get the non-C= MA 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? Hmm... it seems not possible. It's allocation context API and maybe actual allocation happens in handle_mm_fault() or it's successor. We cannot use a special entry point for allocation there since it's a general function. And, IMHO, making a special allocation function that bypasses the pcp list would not be a good practice. Thanks.