Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6823339imu; Mon, 3 Dec 2018 03:29:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/U/WL+xaTxrI07HvwIL7mZZQxcNzURM51jO3WkhYqvd3KOfwM/KGApimHqhtzogNPNWQThE X-Received: by 2002:a62:a99:: with SMTP id 25mr15280679pfk.121.1543836585745; Mon, 03 Dec 2018 03:29:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543836585; cv=none; d=google.com; s=arc-20160816; b=lJ4709fy3tPsyByHs5o8LZpYO/mzu8fpnbDiZF1e1HWnlcLKe9QB9r/jC8ULZR5iXD Y/Ly1XeBMKsAB/l5iDt7WMt/hJEL8ctnF5eQxbsU2FHosiBEx1QMmtKY895/1bS2o6pH t7cd0344p2JWj9TY0o166FDENs9EmBTS/0BQ5S6eXUX+h6/pLSm4i7TuGQGl+usGbXvU 1hlUAZNkFKWxJoNGfM6e/fJ2d9q5jxFaf4k22Jl8EzjSV+7fdCBc1CnKqNh/TY9ZaU+W u4IEEMLiA8vxpg0I1cQTKa1HgdMhM9lS1KYHRX4fB2CFCy/ko0TGWQ/41Jc+peHBOVdH 49EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=0iuWjkOxQBenD+P0anRhGKAmECB3xqeSTJUQgXhNipM=; b=c8XspNyRp+aeNaeXdPvL9p8/wgyrezWK0RwY3ODqLHZGGgfFKpgYlbvtBqzGRQFXX6 Gu4DdzQEf/qPCEKQAbt/FoM2aJMJoO1Tvy0H9U+5bWwVlAW0apvs5IEeTPEImW8ozsxJ mULR3TpBSQLyT2OKmK3rntTYlXNjfvuQPHaV0GVTe7IBV2GHJuVujJzG8M12syk89s4v qldPwUANE7PKc0r8vO5DfZBJv5dGH8B0IyEuBqc7L4SktI74s0km2eROjykALvVh1wVH gmAaMDTilP6bFmH4uacljPmrwO0NoS42jS0HuDRRo+n5JEsMoXbYbzU4p4hKQiESfmdQ mWTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=YcbDIi22; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c132si11863474pga.597.2018.12.03.03.29.30; Mon, 03 Dec 2018 03:29:45 -0800 (PST) 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=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=YcbDIi22; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726243AbeLCL3e (ORCPT + 99 others); Mon, 3 Dec 2018 06:29:34 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:46415 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725888AbeLCL3e (ORCPT ); Mon, 3 Dec 2018 06:29:34 -0500 Received: by mail-pf1-f194.google.com with SMTP id c73so6193274pfe.13 for ; Mon, 03 Dec 2018 03:28:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0iuWjkOxQBenD+P0anRhGKAmECB3xqeSTJUQgXhNipM=; b=YcbDIi22C/mj8dTPsTqTqOsoZmTffMkY3DuFZhaUfqik5+1VcreRJ/LCvn9dYtTrSa csE8lIr7zRJ7NQO/n45fmLijg4pQQLRYaSbkvI7MnTTwtJ8Cin916Q+ygtAXL1UO4Chb /oVpWn1MqONnCiFFM/FNjd+gTIH+ZsfV9fcKh3KZS5lyfxrbKAf2UwJ5iRh/beHsdkH3 8JtUJKz863w0OrtV4KlF2/Fp5OMnvb6ADY+wFY1oBscsLl21iKa5BMuMYn2FT5Rk1uwi WSL+2efZyP2yi+PSyWpU8GBijK+mzdh/6eUcOrGVP9bihPUcVAImVf7U3atIalksTB5m 3xtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=0iuWjkOxQBenD+P0anRhGKAmECB3xqeSTJUQgXhNipM=; b=acb7jFT0UBYXekCX1TZUDqqVkzodutyyH5+f30DZQuXNHYvh7z6cCtPpV2vbY4a8AF pLExA3U7O2vsQa7oGpWVN8RRwGuxcO1myQuBLdnPD+j2SwEkNbzD7+St1tgKEnBO+ZWG Sj2TQiC6qMrzgH75iwtzDW/MBWNN8oNvN1mbFlvb9gBVUMe5qP3qip+4lzOpkSLx1iTB WtCFsPz1vxdZgdGD78IANAAPA3FddVqgYRyVFDXpkKpfEI2CMDTY71Ss1x/aoALNREsr jwo+6Yg+VmwCp09G8NKhQgzKX++GiQvweB3vH25Zt/D4qwoT7Ldkk2awhXT2RA7hxWek EG+w== X-Gm-Message-State: AA+aEWZtscEcqsAMQxynIJfQoTZi0Ve1L3EyLHhqHmBDP65OlEOHxSRm zvCB5nTkGcKD19jh3jZazqoAOw== X-Received: by 2002:a62:8096:: with SMTP id j144mr15782356pfd.140.1543836534489; Mon, 03 Dec 2018 03:28:54 -0800 (PST) Received: from kshutemo-mobl1.localdomain ([134.134.139.82]) by smtp.gmail.com with ESMTPSA id x3sm21602445pgk.18.2018.12.03.03.28.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Dec 2018 03:28:53 -0800 (PST) Received: by kshutemo-mobl1.localdomain (Postfix, from userid 1000) id BBDA53003F7; Mon, 3 Dec 2018 14:28:49 +0300 (+03) Date: Mon, 3 Dec 2018 14:28:49 +0300 From: "Kirill A. Shutemov" To: Laszlo Ersek Cc: Jan Stancek , linux-mm@kvack.org, alex.williamson@redhat.com, aarcange@redhat.com, rientjes@google.com, mgorman@techsingularity.net, mhocko@suse.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm: page_mapped: don't assume compound page is huge or THP Message-ID: <20181203112849.jonqywnd4rx2wpe7@kshutemo-mobl1> References: <35a664c0-6dab-bb32-811e-65250200d195@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <35a664c0-6dab-bb32-811e-65250200d195@redhat.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 03, 2018 at 11:23:58AM +0100, Laszlo Ersek wrote: > Totally uninformed side-question: > > how large can the return value of compound_order() be? MAX_ORDER? > > Apparently, MAX_ORDER can be defined as CONFIG_FORCE_MAX_ZONEORDER. > > "config FORCE_MAX_ZONEORDER" is listed in a number of Kconfig files. > Among those, "arch/mips/Kconfig" permits "ranges" (?) that extend up to > 64. Same applies to "arch/powerpc/Kconfig" and "arch/sh/mm/Kconfig". > > If we left-shift "1" -- a signed int, which I assume in practice will > always have two's complement representation, 1 sign bit, 31 value bits, > and 0 padding bits --, by 31 or more bit positions, we get undefined > behavior (as part of the left-shift operation). > > Is this a practical concern? Not really. Assuming 4k PAGE_SIZE, compound_order() == 31 means 8 TiB pages. I doubt we will see such allocation requests any time soon. Even with 1k base page size, it's still 2 TiB. We will see other limitations in page allocaiton path before the compund order type will be an issue. -- Kirill A. Shutemov