Received: by 10.223.176.5 with SMTP id f5csp559601wra; Fri, 9 Feb 2018 03:35:22 -0800 (PST) X-Google-Smtp-Source: AH8x2268lyvmBT5I8PA/wxTH9stjdiw1CqqCcqsvxPxB0f48kXacxUzYodNOJbjDF0MCQ++3ksyP X-Received: by 10.98.34.15 with SMTP id i15mr2564093pfi.168.1518176122021; Fri, 09 Feb 2018 03:35:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518176121; cv=none; d=google.com; s=arc-20160816; b=jIxDBieuwedvrkuinpmEB8ifjprKX+M5YGx+AwQUGIv4QjLbk6k0/wvUyeVduc++lO JF/ysy17DZjrPax4qkqHY9BsNjZ7km6QEbnJ7jTCoxL++Nnn8xGwWmYkns53SSSKwHH9 TA2L26cJajkbi5RUMOj4GQR5wo+UTUavWBhKYM26Hb6VuHuB4A/D2ynt9BLAqKsESwx/ M3alL11Juj6MjZs3u7Q6gOaYKtoQjRP/yiSga4LTSnR7zMf3TeZWdOwb7rHA+xVHCdtP xMckAdoizBbVWwRG/kpAebwFzfQ0mL35GDlDvYlgy25ZiOdYiGO4ADTFkU9aQiJatcbr ZxAg== 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:arc-authentication-results; bh=X3yQUMdhgQCoKAbBYDiaBYroQjt/Olukc4cmrE9MxCM=; b=e8K0XsXVYBqysm6+aib3qgCFiZJSWiB30K6/Kg1tQn43/HF3lV88i7fazXUdvtTzF+ uWgiIS+0LjdN2i6Nn6RGNa6tQfQgdKn/qn5led0SCKkQaArO/stbW4/tmPYXnKxRE5dh bhg6LpM8MqBVXj4d5NY0DlCwYj9FKV3Ky6Y0REZoIsS9tKj+vZ1T9QX1b7DBhGuXM0RV tqQd4XTMS0Y5P6x4qI+9ReODPLAXpdu6AQEfNv3cE+iVY9GoQItgw6ITKo3FiXnkxlM1 54Bqg1XvVHdKUzkHWSR6APeFGBcA2W+WIl+nPxEDOA1GrOa+rROsmvkdQuNQtaUZYiss eBxA== ARC-Authentication-Results: i=1; mx.google.com; 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 m5-v6si1428551plt.642.2018.02.09.03.35.07; Fri, 09 Feb 2018 03:35:21 -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; 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 S1751150AbeBILeZ (ORCPT + 99 others); Fri, 9 Feb 2018 06:34:25 -0500 Received: from lhrrgout.huawei.com ([194.213.3.17]:26012 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750997AbeBILeY (ORCPT ); Fri, 9 Feb 2018 06:34:24 -0500 Received: from LHREML714-CAH.china.huawei.com (unknown [172.18.7.106]) by Forcepoint Email with ESMTP id CAC7DC75B79F9; Fri, 9 Feb 2018 11:34:20 +0000 (GMT) Received: from [10.122.225.51] (10.122.225.51) by smtpsuk.huawei.com (10.201.108.37) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 9 Feb 2018 11:34:16 +0000 Subject: Re: [PATCH 3/6] struct page: add field for vm_struct To: Christopher Lameter CC: , , , , , , , , , References: <20180130151446.24698-1-igor.stoppa@huawei.com> <20180130151446.24698-4-igor.stoppa@huawei.com> <48fde114-d063-cfbf-e1b6-262411fcd963@huawei.com> From: Igor Stoppa Message-ID: <47f64329-32e2-44ba-c878-ee3cccdebfea@huawei.com> Date: Fri, 9 Feb 2018 13:34:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.122.225.51] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/02/18 17:33, Christopher Lameter wrote: > On Sat, 3 Feb 2018, Igor Stoppa wrote: > >> - the property of the compound page will affect the property of all the >> pages in the compound, so when one is write protected, it can generate a >> lot of wasted memory, if there is too much slack (because of the order) >> With vmalloc, I can allocate any number of pages, minimizing the waste. > > I thought the intend here is to create a pool where the whole pool becomes > RO? Yes, but why would I force the number of pages in the pool to be a power of 2, when it can be any number? If a need, say, 17 pages, I would have to allocate 32. But it can be worse than that. Since the size of the overall allocated memory is not known upfront, I wold have a problem to decide how many pages to allocate, every time there is need to grow the pool. Or push the problem to the user of the API, who might be equally unaware. Notice that there is already a function (prealloc) available to the user of the API, if the size is known upfront. So I do not really see how using compound pages would make memory utilization better or even not worse. -- igor