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 65BCBC433FE for ; Thu, 21 Oct 2021 10:40:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1475660F6E for ; Thu, 21 Oct 2021 10:40:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1475660F6E 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 7CCD66B0071; Thu, 21 Oct 2021 06:40:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77D8D6B0072; Thu, 21 Oct 2021 06:40:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 644E96B0073; Thu, 21 Oct 2021 06:40:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0050.hostedemail.com [216.40.44.50]) by kanga.kvack.org (Postfix) with ESMTP id 523A46B0071 for ; Thu, 21 Oct 2021 06:40:43 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id EB10B18230216 for ; Thu, 21 Oct 2021 10:40:42 +0000 (UTC) X-FDA: 78720101124.19.9F1A9B3 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) by imf07.hostedemail.com (Postfix) with ESMTP id DA19D10000AC for ; Thu, 21 Oct 2021 10:40:46 +0000 (UTC) Received: by mail-lj1-f180.google.com with SMTP id r6so804054ljg.6 for ; Thu, 21 Oct 2021 03:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pOBAuVN6JNFOHIGH5sbYmAMZ0cNNUYNZfaKPm0hr+Wc=; b=d0/P+9UObVdNOed4aqrRly7PMFuynMX/yDkBFl9UO778+dfFMEv0/YhoHpSEkYX4f1 HkZSwD77X/OLzHxqpK2eAxNf7v53XaUM6E+V5aGJsp96QIkvNUd21/yhZgtbP3AgQ4Mp Yqt9TRQ2MqlTm5cvYJYCLghY/wBR/ajWSW0XDLgkYjrZCJ9h7QCQcaR/Xx32tvCjA1NR mjQN6AKh/nZXNvFCgG+viQon8U0Q8+/GinC+68Tfdr1ZHEyYdHIOqBflxLN21e4QUb/c kkyckhhfEpvCk4peR94ktXHNtuelWDTUZzljyt9iL4z6J7/jBbhahxj+/NMBo9v8NC03 3exA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pOBAuVN6JNFOHIGH5sbYmAMZ0cNNUYNZfaKPm0hr+Wc=; b=MyPTAYagmiCmM3W8WKsY/AyCXPPWwdT+PCRD/C8qQPrhsyDHS1B2EarHot42Doh9I+ fQ/NVwLgVLke248h65nnnFZdXV2dla/u4MZJMTkEkTqwa48jW1RER+ygZAl9wO6Ex37t Fh6UajfjUaEJrQg9GYL1cZkrbWywSHkB3dVzy5Dp5LI9SQTgNjQ3GGGLPFxRQwB+yW+M xQb/7N4iy4Lm64ax3yBdplW7DtpWP3gExP3f/l0c8mcuyK+wXiY/J1iJv2FdgbzjQjHZ iOw/Z2Ra1/Pti3Dv1nP15H+BOnyOZUJ+arzLILQDhNrYfNC6pYhJaMTNwmiVS00bGnHK NkFw== X-Gm-Message-State: AOAM5323cyUWoOBf91MKceRX1rJBFpHJxsZ4l1ZVLIodNLlUBQPCvZCr YjWWszXHZvIZ7x6EpfG86X0= X-Google-Smtp-Source: ABdhPJweUAYI/2N+dywQaYjXJ2+lEJoHS1HHsj3N2gjN6fnfyTEbDXWNIR1wpjo2PCCKpwVlKRgNnQ== X-Received: by 2002:a05:651c:1201:: with SMTP id i1mr5005242lja.207.1634812841011; Thu, 21 Oct 2021 03:40:41 -0700 (PDT) Received: from pc638.lan (h5ef52e3d.seluork.dyn.perspektivbredband.net. [94.245.46.61]) by smtp.gmail.com with ESMTPSA id 195sm506199ljf.13.2021.10.21.03.40.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 03:40:40 -0700 (PDT) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Thu, 21 Oct 2021 12:40:38 +0200 To: Michal Hocko , NeilBrown Cc: NeilBrown , Uladzislau Rezki , Linux Memory Management List , Dave Chinner , Andrew Morton , Christoph Hellwig , linux-fsdevel@vger.kernel.org, LKML , Ilya Dryomov , Jeff Layton Subject: Re: [RFC 2/3] mm/vmalloc: add support for __GFP_NOFAIL Message-ID: <20211021104038.GA1932@pc638.lan> References: <20211019194658.GA1787@pc638.lan> <20211020192430.GA1861@pc638.lan> <163481121586.17149.4002493290882319236@noble.neil.brown.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: DA19D10000AC X-Stat-Signature: npk9jcjseqfr5qbtmg8s6c9zzg93iaok Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="d0/P+9UO"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf07.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.180 as permitted sender) smtp.mailfrom=urezki@gmail.com X-HE-Tag: 1634812846-59320 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 Thu 21-10-21 21:13:35, Neil Brown wrote: > > On Thu, 21 Oct 2021, Uladzislau Rezki wrote: > > > On Wed, Oct 20, 2021 at 05:00:28PM +0200, Uladzislau Rezki wrote: > > > > > > > > > > On Wed 20-10-21 16:29:14, Uladzislau Rezki wrote: > > > > > > On Wed, Oct 20, 2021 at 4:06 PM Michal Hocko wrote: > > > > > [...] > > > > > > > As I've said I am OK with either of the two. Do you or anybody have any > > > > > > > preference? Without any explicit event to wake up for neither of the two > > > > > > > is more than just an optimistic retry. > > > > > > > > > > > > > From power perspective it is better to have a delay, so i tend to say > > > > > > that delay is better. > > > > > > > > > > I am a terrible random number generator. Can you give me a number > > > > > please? > > > > > > > > > Well, we can start from one jiffy so it is one timer tick: schedule_timeout(1) > > > > > > > A small nit, it is better to replace it by the simple msleep() call: msleep(jiffies_to_msecs(1)); > > > > I disagree. I think schedule_timeout_uninterruptible(1) is the best > > wait to sleep for 1 ticl > > > > msleep() contains > > timeout = msecs_to_jiffies(msecs) + 1; > > and both jiffies_to_msecs and msecs_to_jiffies might round up too. > > So you will sleep for at least twice as long as you asked for, possible > > more. > > That was my thinking as well. Not to mention jiffies_to_msecs just to do > msecs_to_jiffies right after which seems like a pointless wasting of > cpu cycle. But maybe I was missing some other reasons why msleep would > be superior. > To me the msleep is just more simpler from semantic point of view, i.e. it is as straight forward as it can be. In case of interruptable/uninteraptable sleep it can be more confusing for people. When it comes to rounding and possibility to sleep more than 1 tick, it really does not matter here, we do not need to guarantee exact sleeping time. Therefore i proposed to switch to the msleep(). -- Vlad Rezki