Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2151226ybi; Thu, 4 Jul 2019 06:02:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSaG9u5bEwGmmTpoK8pT4PM6yHX7vb8fUQIfIlafOzgG94xHrSG9Fltr3siVXmwgjmPCky X-Received: by 2002:a17:90a:2430:: with SMTP id h45mr20244573pje.14.1562245338765; Thu, 04 Jul 2019 06:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562245338; cv=none; d=google.com; s=arc-20160816; b=EPsBCdmOu0aN+9yT/98w/LMv8LvqW8cHVmuNkE06QqY9w7JYNHx5BnayXYIKYVsYzy Ie7PGZyh6HeabgxxCpwWssZH2/4CpIyw6qkhLhTj3OruBRNAjpvCwpO3hxdQHYm1jkco bKZmXq0Or51VUKXpDUwgJZfAJLqJOr33AzpBfMUpfUmL8RroZ99rvQ3LQpRZb2Ax6Q6a 0n5ejG+cnuyYuXF2Sduqz2AA2ClUAEGDMjENbV+dPte7xUOBQnWUCiNZ9OMp6jOqXC48 fN2BdSPwqYhi/YWRD9aJNCQanjczWIMO4chMpKxyq/ycr3YSbQ8e392g/om23v2l2KH3 rlvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=W3YX4qyiQ8io0QlAlJhhQ1BpPb12I9CxfxqXtbQ0TLk=; b=ndno44AFA8GjqUEXcgKzan0xasowpk4wTFcoChqD2kpWWC/mGhedlnZ1cRwMSwJogo IFbQfN/j2aUGdxD0vsoFhjrXjHwFOa8+Xryebrm7FFO+sKrj9Fv4X9lmXJhw7FDutKa8 /D68k9mBxKpj4b8jAXr6hXRAqyj4dj28CCXyRyBbU0vN8eRy8j/aYaCzSzgPGtDh87GI JrPpmAwV4kqbjC9xUasudGlMGxxPxsjnMnmGvosN/5Ezv6ba3Fij0rsCzdMBoU4mPvm+ wlIyGKqp8ZahYkmD+34pkCYH9OW+vLSRxgTwBkJbIAgi+3RZfXMnc6dAt1aV5vf9s5F/ 00wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E3JZ9ogc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id i2si3196501pfb.206.2019.07.04.06.02.01; Thu, 04 Jul 2019 06:02:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=E3JZ9ogc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727264AbfGDNAG (ORCPT + 99 others); Thu, 4 Jul 2019 09:00:06 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:37448 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725945AbfGDNAG (ORCPT ); Thu, 4 Jul 2019 09:00:06 -0400 Received: by mail-ed1-f66.google.com with SMTP id w13so5366035eds.4; Thu, 04 Jul 2019 06:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=W3YX4qyiQ8io0QlAlJhhQ1BpPb12I9CxfxqXtbQ0TLk=; b=E3JZ9ogcwZlSvahnLgdA879/a0BsQcwPHH8vTp1K3ZWV/6I7UECgSepeJxMFSdGRtg gKLM/46akrIUDBGrhZvZyVB9uCmyyK53zrTd2seYk7/zWRwSesJl3dD2cor46695IDfd sk6F0r8vJ2WiV53oqyU0ecCX6mh8yaCMltvd+oMts+ccs/hHClYdLKBWKBhBRZ6dv+Y1 sK23uPIZUQ0jPFIyUIicscj90bg8F70bxeuaugKdC1vC/WrOM79YujMTmmBlp5bqVVQS 0dnbKogj+GCwz60Ok3miQDyMjnm9n49s58WLI7UrJ71L25mrumXbsypWphmqfP6vGxDq arJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=W3YX4qyiQ8io0QlAlJhhQ1BpPb12I9CxfxqXtbQ0TLk=; b=IHecRWqpT5hR+6xIMwQVYt2qE/BfmkN4gAL0YWXAqW9UQpGAi4qhj5MpPAXSgamYxd 71N+9384YrfZEktzsXW+lKsc9VnupGZ6EJqoCNWvCLU3JXj9DZwEj1ZYdn30b9gwZzQv HlLV7pdnZBSVZ+g/tD+8P+QZBKtGx5pMTSgO397UGz8kuJwcDMruF3V7OVMJ3TewFqjQ dMAPfleZQjp6oP1CLf/S1FyDBycusIVjIeoGGRLH3OYU5/dxRTf1OjuZQqaNur09xNyc doQ9jwS9krpRgizhIE6+6cZgMdM4OZLNeHyoAhHh8vS5i5pZOE120xzZlZN3PAK7GGqX mIKQ== X-Gm-Message-State: APjAAAV02hFbq12S5906KxadORsp/v58TLNOzjwOgdTQW7pNC8DrJRy8 HX/Mf2DSJcX0d6U9Y2j8s3nK4Jl4 X-Received: by 2002:a17:906:d7ab:: with SMTP id pk11mr39519655ejb.216.1562245204270; Thu, 04 Jul 2019 06:00:04 -0700 (PDT) Received: from [10.68.217.182] ([217.70.211.18]) by smtp.gmail.com with ESMTPSA id z12sm1595238edq.57.2019.07.04.06.00.02 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jul 2019 06:00:03 -0700 (PDT) Subject: Re: [PATCH] dax: Fix missed PMD wakeups To: Matthew Wilcox , Dan Williams Cc: linux-fsdevel , Jan Kara , stable , Robert Barror , Seema Pandit , linux-nvdimm , Linux Kernel Mailing List References: <156213869409.3910140.7715747316991468148.stgit@dwillia2-desk3.amr.corp.intel.com> <20190703121743.GH1729@bombadil.infradead.org> <20190703195302.GJ1729@bombadil.infradead.org> <20190704032728.GK1729@bombadil.infradead.org> From: Boaz Harrosh Message-ID: Date: Thu, 4 Jul 2019 16:00:00 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190704032728.GK1729@bombadil.infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-MW Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/07/2019 06:27, Matthew Wilcox wrote: > On Wed, Jul 03, 2019 at 02:28:41PM -0700, Dan Williams wrote: <> >>> +#ifdef CONFIG_XARRAY_MULTI >>> + unsigned int sibs = xas->xa_sibs; >>> + >>> + while (sibs) { >>> + order++; >>> + sibs /= 2; >>> + } >> >> Use ilog2() here? > > Thought about it. sibs is never going to be more than 31, so I don't > know that it's worth eliminating 5 add/shift pairs in favour of whatever > the ilog2 instruction is on a given CPU. In practice, on x86, sibs is > going to be either 0 (PTEs) or 7 (PMDs). We could also avoid even having > this function by passing PMD_ORDER or PTE_ORDER into get_unlocked_entry(). > > It's probably never going to be noticable in this scenario because it's > the very last thing checked before we put ourselves on a waitqueue and > go to sleep. > Matthew you must be kidding an ilog2 in binary is zero clocks (Return the highest bit or something like that) In any way. It took me 5 minutes to understand what you are doing here. And I only fully got it when Dan gave his comment. So please for the sake of stupid guys like me could you please make it ilog2() so to make it easier to understand? (And please don't do the compiler's job. If in some arch the loop is the fastest let the compiler decide?) Thanks Boaz