Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp487094pxb; Thu, 21 Oct 2021 03:41:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4VmpN60OssVMtahgrgG+twTha/9YU+w1LoskgUJZCdrr98q6wOoienwTImo8R/oM08tov X-Received: by 2002:a17:902:70cb:b0:13e:91f3:641a with SMTP id l11-20020a17090270cb00b0013e91f3641amr4393942plt.13.1634812913327; Thu, 21 Oct 2021 03:41:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634812913; cv=none; d=google.com; s=arc-20160816; b=jSk3/fSeof0b2Kmnb5nuiGi1rv2vAFKlgfG3RrfPGGF1BA5/2r+8Icmzkgbym0IBkw is2F1H+wwMwOKl9j+Sy/1d8gqdvidzqnxbycb9MS/TT76vuG0kqARe0RIQsZ6uTzmsEU EX2eYmZScVROILbQSGUBcwM4UJMyB/4vqULdsoRIH0vmrbBGTB5EkDYECuq6r5QsYOy+ lpWQ3FpOOiFKfspRtt4MhHa0RKmYTiUV+kmBPM38RnxuNnHFP7MCDUJycLeEnG3fJdyy iHtH5TPHYs2HK7VUiMj+lHWDsHPhQ4QhXNZVdXQgs+wx0cBvEvsnusUPFiBW00req0iA CyLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=pOBAuVN6JNFOHIGH5sbYmAMZ0cNNUYNZfaKPm0hr+Wc=; b=a4RuRFoonjWeHDphxIdg0rw3RNFl6wIHj05whXXrNvu7LU8yK5HL1RLirOOC2DY7J4 5bZMniyow0TfjVXQpzIhHn9Nr1nN3Xcpc7RMJ2BEe+dU66idpEXgQ+x4Evl1DNji3Tta Sed1YZi9jm4ofkCUTd8LHVq4NYQd6YCe2DnwgIzv8vAJvydZ/UAK65VKajqK6JN95rI4 C+sDXdpJQx2GM+jtpq1f78EkrKLAW+zQ0N7D+sVshpbkX1WNQd6suN6mkb7MvbfeGh4o 2ISPCoF6ivlc8+CzPE7bV1WlSnXCAfWxJfvxPeobGUieL1OL19ILFf2skA7aahOwy6bC gmOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="d0/P+9UO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nn4si7428604pjb.135.2021.10.21.03.41.39; Thu, 21 Oct 2021 03:41:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="d0/P+9UO"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230327AbhJUKm7 (ORCPT + 99 others); Thu, 21 Oct 2021 06:42:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbhJUKm6 (ORCPT ); Thu, 21 Oct 2021 06:42:58 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F3E4C06161C; Thu, 21 Oct 2021 03:40:42 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id l5so1084095lja.13; 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=jk0x9Sa+WwQJgOBBxfuA1sr/wMXLwdhQA3KPCFxSkz8Cd3iuNyEdR6jEqlPU2nMH32 jkL4w5OT837ioQPUi2CKmk/NtMM5aLmYb+i1Sbjsr7kYbCBl78Hk6luu5sQeKc2PlA3k H1HNC5uQmg7PY2tRUkb7Asd6xISjQzvSSFzWWyOqv9hC4mmR+JcNLj6aBQfLTjTMD5Qd GrlIBPOvxq2lZgFVxNB1d+QPXSOPszqOuCCexsRq9VF6aSqYDE9+5MYT0ku1Fmvv0l3W feRwxmgbFi78sYZaYiRsr0ydsac0yFHQ3//jkTGgfM56sc+JxNL+Sm05B+pZUHri1NA/ CXeQ== X-Gm-Message-State: AOAM531BpaRqCrPXWjg5ivHhtN+9TfGIaWD/irzfNfpev1c8f+Ytst2l dUQofHiG4KuXtC4bikNMDBCRHcw68BDm9Bo8 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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