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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85C27C433EF for ; Mon, 25 Oct 2021 14:30:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2DC0C60F46 for ; Mon, 25 Oct 2021 14:30:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2DC0C60F46 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 517366B0071; Mon, 25 Oct 2021 10:30:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C723940007; Mon, 25 Oct 2021 10:30:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 38EA76B0073; Mon, 25 Oct 2021 10:30:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id 258996B0071 for ; Mon, 25 Oct 2021 10:30:47 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id CFD5A182B69DD for ; Mon, 25 Oct 2021 14:30:46 +0000 (UTC) X-FDA: 78735196092.20.44354EE Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by imf19.hostedemail.com (Postfix) with ESMTP id 01C61B0000A3 for ; Mon, 25 Oct 2021 14:30:41 +0000 (UTC) Received: by mail-ed1-f49.google.com with SMTP id z20so255204edc.13 for ; Mon, 25 Oct 2021 07:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FmXQJiEvyexYZAONYS1YO/YN6HE7AsF0Zix0o2xmTTs=; b=YmjZEhwNJ2zDDKg7PLfT6QNaOw4P3QVEVGpEa2VRRtXHHIKks3DTI2BvjyglKfUxuk 0mlJ9CyhXZL91zeGmZlYEy1v7KcEouS/uUKkvHWzW4/xttXtoHXvS+yztHbugX+PQz20 zYaKRLql3hMtyMt0/Jq1/kvC2my1hyAcMvIUXfgOwhxsTd7grf5UXfZKshUxHrcF/xel wG82/s7mKbbUlGYrZvde4MyDDb5LN12zm8HHYgwRSEiFy50sBapcBt+quOjvtr8DO9tP ez2wHieQ+AefXVUT9mBA9y2UHnhM3zaeoHusYa/ZqPwFRkOj/4Vb34dGPgLTNqG3y8Ja aUVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FmXQJiEvyexYZAONYS1YO/YN6HE7AsF0Zix0o2xmTTs=; b=kdJ3Dt5mnxMhmzqoF4ABK4NEO00onsMhgnlAREiTLUpMb7dKuhROBVjDc06A+OFQhh c+qnGduLrrlcK9azCQX9FArjeu8nA3rvdJjrSzWQJwZ899VyjHBPdBYRISFAIsmyUM/z u4a1eevF9h/ubpNLhCBZKdUdCF1EkdeGoMx5PiY41V8iGY50pTT6SkqmnRZQ9ksP16ma QmgeVwh4Z+EHyuUB4aObalT91baQEyMZ61B4v+dyAhJWkHFvy/j39LYICrQFcGH/fc6x dGHbLL3K2V43vZIuvn5g4FuNx4F6NIX4i2d4RLsWxUzA7rqWem/e3GlHozO9sQTRXcEE y9YA== X-Gm-Message-State: AOAM531kqTFKCfpPhq5nYMB2q35wiIEckMmy2duJhkiV7PVzjZANEiyY ueebSXH2w40rSB7Ss/m0VpJikVGOHbtopaC0MOc= X-Google-Smtp-Source: ABdhPJzmdRna3K6azm05c9x9j7TXfHuxwBtu0a80+n+XCgX3jLVIB8JKvIGWBLQfKYgJJaRmcJPVmLRTVJTqIQ5YRhk= X-Received: by 2002:a05:6402:22d6:: with SMTP id dm22mr27220376edb.209.1635172235120; Mon, 25 Oct 2021 07:30:35 -0700 (PDT) MIME-Version: 1.0 References: <20211020192430.GA1861@pc638.lan> <163481121586.17149.4002493290882319236@noble.neil.brown.name> <20211021104038.GA1932@pc638.lan> <163485654850.17149.3604437537345538737@noble.neil.brown.name> <20211025094841.GA1945@pc638.lan> In-Reply-To: From: Uladzislau Rezki Date: Mon, 25 Oct 2021 16:30:23 +0200 Message-ID: Subject: Re: [RFC 2/3] mm/vmalloc: add support for __GFP_NOFAIL To: Michal Hocko Cc: NeilBrown , Linux Memory Management List , Dave Chinner , Andrew Morton , Christoph Hellwig , linux-fsdevel@vger.kernel.org, LKML , Ilya Dryomov , Jeff Layton Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 01C61B0000A3 X-Stat-Signature: 1d1thh157ba443qcprtifk8ndg8z15oi Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=YmjZEhwN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf19.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.49 as permitted sender) smtp.mailfrom=urezki@gmail.com X-HE-Tag: 1635172241-688922 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: > > I would really prefer if this was not the main point of arguing here. > Unless you feel strongly about msleep I would go with schedule_timeout > here because this is a more widely used interface in the mm code and > also because I feel like that relying on the rounding behavior is just > subtle. Here is what I have staged now. > I have a preference but do not have a strong opinion here. You can go either way you want. > > Are there any other concerns you see with this or other patches in the > series? > it is better if you could send a new vX version because it is hard to combine every "folded" into one solid commit. One comment below: > --- > commit c1a7e40e6b56fed5b9e716de7055b77ea29d89d0 > Author: Michal Hocko > Date: Wed Oct 20 10:12:45 2021 +0200 > > fold me "mm/vmalloc: add support for __GFP_NOFAIL" > > Add a short sleep before retrying. 1 jiffy is a completely random > timeout. Ideally the retry would wait for an explicit event - e.g. > a change to the vmalloc space change if the failure was caused by > the space fragmentation or depletion. But there are multiple different > reasons to retry and this could become much more complex. Keep the retry > simple for now and just sleep to prevent from hogging CPUs. > > diff --git a/mm/vmalloc.c b/mm/vmalloc.c > index 0fb5413d9239..a866db0c9c31 100644 > --- a/mm/vmalloc.c > +++ b/mm/vmalloc.c > @@ -2944,6 +2944,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, > do { > ret = vmap_pages_range(addr, addr + size, prot, area->pages, > page_shift); > + schedule_timeout_uninterruptible(1); > We do not want to schedule_timeout_uninterruptible(1); every time. Only when an error is detected. -- Uladzislau Rezki