Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1374721rwb; Fri, 18 Nov 2022 17:48:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf6+NSpEGzixJTrDZKz6VPFoY9FMreUsfNrhhMPFFegBCaADRmIawvXd1Otb1u5YtH4SNc90 X-Received: by 2002:a17:90a:d106:b0:213:1944:dde2 with SMTP id l6-20020a17090ad10600b002131944dde2mr10251894pju.193.1668822490675; Fri, 18 Nov 2022 17:48:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668822490; cv=none; d=google.com; s=arc-20160816; b=uPt/46k3MNeVBRR8owwT/uU71dinJMd88GN1dEM0WjkK7U1PRwG96QoQhyFMqeB0yR ggq0xZ5eM2pOfb0gOjvL0Knv8EBH4b+BN0NvX+bbpWfFHl9uoFXg9uuRutfyXJ6p2rAA clwuQFIXb9014vzPmgDFIrw74Gg0zMUPIzgmgnJyV1HK3Ed+J5d3PtyBfEvho4tOpdlP KGpasCo0WcqVSysadTzgNKuN0yUXMGMBpJyax4QXKl1QXzG9Pz0uabMd0N79Ju2DjMN7 l9noRREE9j2zrCVj5YiJyZG+OJI71Ka0zCxeXVHKVaFsJVXZ00ufcY8Gcd4dhhbmEMB6 HXrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=eSj2/cLHt1SdQObKh67xzbIPuUwvEskces+Lnu0fKrQ=; b=g9XhG10kX5PwT0x1fZ4F4iEICKDAWPkbXLjw3zZ9tT0OiJUb14JZI3XfHjXck/Bz1Z 82U6ywY0WEe2kE8iB0BjS3hYENeJ6Kp8jiPP9QhrEdCFKtvATVWragYQ+oXzsek9WT0i KqyhfvMmEaIqIs7wCuewF2gQMYjFvtK8fepjE3wgS3j7k24/DzsixnukQN8HTvgkXjiQ lIB1xmct860bsNjlX+4xTpHKy03uMPGRsKXYBahgo00IBxgV/p5y3JTu3yu9DaC32Y+0 mGrBv56YgW5TX9ZY5lvlE6b5aBMDjxTs9cqNztWp8VyptBUydmZ49yAUApGkgSXRvclT VEsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=Lod+RJl5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h17-20020a170902f55100b0018018272902si5693139plf.554.2022.11.18.17.47.59; Fri, 18 Nov 2022 17:48:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=Lod+RJl5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232349AbiKSBnC (ORCPT + 90 others); Fri, 18 Nov 2022 20:43:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232985AbiKSBmn (ORCPT ); Fri, 18 Nov 2022 20:42:43 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 731DFA28A0 for ; Fri, 18 Nov 2022 16:48:43 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id w4-20020a17090ac98400b002186f5d7a4cso6197587pjt.0 for ; Fri, 18 Nov 2022 16:48:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=eSj2/cLHt1SdQObKh67xzbIPuUwvEskces+Lnu0fKrQ=; b=Lod+RJl5ay4LW7CCVlbLVUpVW9yWRmjZS7z4BgLn9FMTNVOMqDo575AiTzf60tmQ7k 1EX58Lueuy4m/3mWqyE+pMkUTKz3s5nj2gQwc6eVlmACBwow8YCLU/nsCqdAbZ8d2mIK jF8QPdH+gSoH53sUSzO25R7eb3xC3lTEbIKviDGAW6J5r4ssCLHrEnQrkU0TlZ3k6wGV REZwacxFiMi7qyROKMRk4RwZ1VzfdsgggKrDrjMzNMbleR1EmdEEgi+6NPSbBWYoSvOn fk3RDude0PcKMooAKfQAuDS/qWB0tlSvfrhCSCJDGUtP3TuZOSvPVzb1db/bRzJ8/bjK p/SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eSj2/cLHt1SdQObKh67xzbIPuUwvEskces+Lnu0fKrQ=; b=KtOeEtjjrhqPFslNr2b3ZwL6pTP1j8XP/YFli9wigJ3onl3euddNHja0D7toPqaPs1 JSlIomzBVV6eaxg/2z/ojw5bfNFuk5GfnJxAybM2BPMGutAyr+oeA33sl6nvGEWO/a1c WO6eBmi2e/QTAqSogZA3tqvjSlWdq7V43cN+4O78Mhy15zHMsLeP6tmbRfn23Vw5HNUj t+LgaLhGuKvrve5fsDqf8bgs3vcyCq5OsfM/Nyvsq5XGXdNi3tBpWL9eF1BgrUjNQfyR g2QXkX5LTT3KtF7lJIYKy0PGg54YlhnQKUsFlk/7JGAFO/vfeFfxLmnRhIH6CzkVMDsc gO1g== X-Gm-Message-State: ANoB5plOj7FwPcHe8AuvQrn1lA7u2XT93/2mGuGk/L1kIoAKQfIOtCk0 GlfBVVAXxakCznadQbmSzN5tnw== X-Received: by 2002:a17:902:f391:b0:178:71f9:b8fc with SMTP id f17-20020a170902f39100b0017871f9b8fcmr2021518ple.44.1668818922973; Fri, 18 Nov 2022 16:48:42 -0800 (PST) Received: from [10.255.94.72] ([139.177.225.224]) by smtp.gmail.com with ESMTPSA id e8-20020a630f08000000b0046faefad8a1sm3382499pgl.79.2022.11.18.16.48.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Nov 2022 16:48:42 -0800 (PST) Message-ID: <4d6eb453-2ba5-12f3-8dff-7074a62441ce@bytedance.com> Date: Sat, 19 Nov 2022 08:48:36 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH v3] mm: fix unexpected changes to {failslab|fail_page_alloc}.attr Content-Language: en-US To: Andrew Morton Cc: akinobu.mita@gmail.com, dvyukov@google.com, jgg@nvidia.com, willy@infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, stable@vger.kernel.org References: <20221118100011.2634-1-zhengqi.arch@bytedance.com> <20221118134236.17a67804b3b6e6c157d8ea02@linux-foundation.org> From: Qi Zheng In-Reply-To: <20221118134236.17a67804b3b6e6c157d8ea02@linux-foundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/11/19 05:42, Andrew Morton wrote: > On Fri, 18 Nov 2022 18:00:11 +0800 Qi Zheng wrote: > >> When we specify __GFP_NOWARN, we only expect that no warnings >> will be issued for current caller. But in the __should_failslab() >> and __should_fail_alloc_page(), the local GFP flags alter the >> global {failslab|fail_page_alloc}.attr, which is persistent and >> shared by all tasks. This is not what we expected, let's fix it. >> >> Cc: stable@vger.kernel.org >> Fixes: 3f913fc5f974 ("mm: fix missing handler for __GFP_NOWARN") >> Reported-by: Dmitry Vyukov >> Signed-off-by: Qi Zheng >> Reviewed-by: Akinobu Mita >> >> ... >> >> -bool should_fail(struct fault_attr *attr, ssize_t size) >> +bool should_fail_ex(struct fault_attr *attr, ssize_t size, int flags) >> { >> bool stack_checked = false; >> >> @@ -152,13 +149,20 @@ bool should_fail(struct fault_attr *attr, ssize_t size) >> return false; >> >> fail: >> - fail_dump(attr); >> + if (!(flags & FAULT_NOWARN)) >> + fail_dump(attr); >> >> if (atomic_read(&attr->times) != -1) >> atomic_dec_not_zero(&attr->times); >> >> return true; >> } >> +EXPORT_SYMBOL_GPL(should_fail_ex); > > I don't see a need to export this? Yes, my initial thought was that there might be a driver using this function, but there really isn't one yet. And I see you've helped remove this, thanks a lot. :) > > -- Thanks, Qi