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 5BB4AC43334 for ; Sun, 3 Jul 2022 12:51:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5CE496B0072; Sun, 3 Jul 2022 08:51:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 57DC26B0073; Sun, 3 Jul 2022 08:51:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 446206B0074; Sun, 3 Jul 2022 08:51:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 35F486B0072 for ; Sun, 3 Jul 2022 08:51:36 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id C17AC349C5 for ; Sun, 3 Jul 2022 12:51:35 +0000 (UTC) X-FDA: 79645774950.14.A00CC88 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by imf27.hostedemail.com (Postfix) with ESMTP id 9655740051 for ; Sun, 3 Jul 2022 12:51:34 +0000 (UTC) Received: by mail-pf1-f178.google.com with SMTP id 65so6644891pfw.11 for ; Sun, 03 Jul 2022 05:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=WmPiuJbwA6+VPj88J0pZ+gchqDIYMYYwl2czRLlfQas=; b=VCZ9yTnm05oEClwMZQpiTjlyEM7mrSYmzRP19wA+I4gvMmqR+Icn1vVxJ4tLVZCryr nBB0a5+kCreGFgfNjlUHZ9TtLPZebPBlzjXKbDtqwxArNWsD9ktI2gYFjrWotK8FJRqz 6Xurgktsu6x1+KbTqtAV7wWBIZKdC0D9Th/rlrf7F0YZsAin49IKUOa3SGTMgY5jS3dh LQcLYUI2RULJS91CHYStHo3M5nLHNSIudqJOS4JpDzkQXfHbdVtx4A7pOeFxu4qBRdby olzDp2NR4ovM4W2qSMV9V4462hRx0kZpM/oIx2XpErQP2lH3CAWkMDqkecEo97BIXiJq 4TiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=WmPiuJbwA6+VPj88J0pZ+gchqDIYMYYwl2czRLlfQas=; b=Gtc2wlOw0id0iEUPbiocpxtfWORKJHKFvxFko6lPXLRbQl/abrdZUfq/oPHl3CxuE6 PwF14oDah9Kx/I3C64JS6W7Lz6uMtca4Qcg4na+xeo+AzWTCKijH6wc6Jsux1QLn/Vai XpeBBMyHxgbC7nGlR/y2aR0BWt0bEoMxItVj7zxV1LSZYiXVkxby2L12Rs+ybqLj8VmN BrKYCAHRF23/1FMxipRht3s1Ie86J/CNORTBxcrUtRrZ0xcX3M2TiOV0bFO5E90zBiBp d8uin4T+KbA+qkm7ibtqCUZaG5wPpWCEnF/sUIHwXtELTV4UklsNC8TBLsqSOljzfY8S nd6w== X-Gm-Message-State: AJIora/1NHuKIdiQ8uKjrQNkWWMJIaS9ZGibWRB+Wf1u7mnSN9MdgdPU rYxjmeR/AUtmyBFprwkAQLNbbSDM7VI+UQ== X-Google-Smtp-Source: AGRyM1tlRVRQIBPww24lBvzL+nIrrwXKkPul/mWJq+gkrczPlQn0tFoL6L7/HMnTmFDeItNUm48CRg== X-Received: by 2002:a63:9701:0:b0:40c:a588:b488 with SMTP id n1-20020a639701000000b0040ca588b488mr20602118pge.303.1656852693425; Sun, 03 Jul 2022 05:51:33 -0700 (PDT) Received: from [192.168.1.100] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id by4-20020a056a00400400b0052551d5565fsm18984843pfb.4.2022.07.03.05.51.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Jul 2022 05:51:32 -0700 (PDT) Message-ID: <275250ea-6c18-2dc9-6d64-9802a5fc9ef3@kernel.dk> Date: Sun, 3 Jul 2022 06:51:31 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v2] mm: honor FGP_NOWAIT for page cache page allocation Content-Language: en-US To: Matthew Wilcox Cc: linux-mm@kvack.org, Shakeel Butt , Stefan Roesch References: From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656852694; a=rsa-sha256; cv=none; b=nZtBkk0ek76ywhRPRMnznHfyZJE092DEb1cjRFg4FUI+VdJPZgYeHFCfoYCeHgjPzIXsrY 5rN8dx4iYkUPrI+YjzUXIErd1vZwQlTjmdBFxWbnv1exgCxacI8oGT4/XB3+EDjZypb2We bjSZiiu9Y9buDijH1Mrdyo+LIYGI1cg= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=VCZ9yTnm; dmarc=none; spf=pass (imf27.hostedemail.com: domain of axboe@kernel.dk designates 209.85.210.178 as permitted sender) smtp.mailfrom=axboe@kernel.dk ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656852694; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=WmPiuJbwA6+VPj88J0pZ+gchqDIYMYYwl2czRLlfQas=; b=E/w2FHvTKOMjneWnXEuwK1wnbGrziDB/iTKe7A2A7aUfYu8Qwp6qqGR4aFRIc79mx6VJIF r1d1RXxvm7+KIViEtEEfCGSb1ECZehfxSKL/SukfvWO2f7cUECXMGcft5pkoCIpfq4DPae B/6Se4WxJqLodXLI4P4riHy82vCgF8s= X-Stat-Signature: c4jteecqaggeys1hx4fu5pozd79tgnzn X-Rspamd-Queue-Id: 9655740051 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=VCZ9yTnm; dmarc=none; spf=pass (imf27.hostedemail.com: domain of axboe@kernel.dk designates 209.85.210.178 as permitted sender) smtp.mailfrom=axboe@kernel.dk X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1656852694-757942 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 7/3/22 2:37 AM, Matthew Wilcox wrote: > On Sat, Jul 02, 2022 at 09:43:32AM -0600, Jens Axboe wrote: >> +++ b/mm/filemap.c >> @@ -1988,6 +1988,10 @@ struct folio *__filemap_get_folio(struct address_space *mapping, pgoff_t index, >> gfp |= __GFP_WRITE; >> if (fgp_flags & FGP_NOFS) >> gfp &= ~__GFP_FS; >> + if (fgp_flags & FGP_NOWAIT) { >> + gfp &= ~GFP_KERNEL; >> + gfp |= GFP_NOWAIT | __GFP_NOWARN; >> + } > > Wouldn't it be simpler to write: > > if (fgp_flags & FGP_NOWAIT) { > gfp &= ~__GFP_DIRECT_RECLAIM; > gfp |= __GFP_NOWARN; > } That won't clear IO or FS, though? We really just want GFP_NOWAIT | __GFP_NOWARN here, but didn't want to make assumptions on whatever else would be set in gfp already. > (I'd prefer it if the caller passed in the GFP flags that it actually > wants, but looking at the patches that prompted this, that seems rather > annoying to do) Yes me too, but that's a lot of annoying churn... -- Jens Axboe