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 90C34C433F5 for ; Thu, 21 Oct 2021 10:27:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1D58D60F6E for ; Thu, 21 Oct 2021 10:27:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1D58D60F6E Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 829EB6B0071; Thu, 21 Oct 2021 06:27:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D9E7900002; Thu, 21 Oct 2021 06:27:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C8676B0073; Thu, 21 Oct 2021 06:27:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id 5C4A66B0071 for ; Thu, 21 Oct 2021 06:27:32 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 11B5C2D38D for ; Thu, 21 Oct 2021 10:27:32 +0000 (UTC) X-FDA: 78720067944.22.C72B093 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf12.hostedemail.com (Postfix) with ESMTP id A206510000A9 for ; Thu, 21 Oct 2021 10:27:31 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 6F68E1FDAC; Thu, 21 Oct 2021 10:27:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1634812050; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=l4CmcbGiUE6TXiVFsiIAM6k/VKLp51ANmkDrpUZ63zM=; b=Oiz0jiaU6hvj8nGCH0fSGOeSVxcZ3yhiH1vQ50E9ah7NBk++5F4jTXDNyIw8OjY0obZlse kmOn2cth6FQ+neI9GqDJlBE0h9K0ld/iMeT3SYYlfCewsN2ZLvBfQ+V7aE0sq/h4eEetKc qEwk9rRZPvOi2K54lSywbbjGw4QbhWY= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 3C8AEA3B85; Thu, 21 Oct 2021 10:27:30 +0000 (UTC) Date: Thu, 21 Oct 2021 12:27:28 +0200 From: Michal Hocko To: NeilBrown Cc: 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: 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: <163481121586.17149.4002493290882319236@noble.neil.brown.name> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: A206510000A9 X-Stat-Signature: 4pb8q1xepaikkh8ijbb6tmasayntg9hg Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=Oiz0jiaU; spf=pass (imf12.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-HE-Tag: 1634812051-486733 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. -- Michal Hocko SUSE Labs