Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1031718imm; Tue, 15 May 2018 12:46:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoAhTLx+BvroJGvFKSbMDLr3SBIy3oWSIy9rs3bgYybCPe+2+eycrJ1x97U3TjmbzzujXAB X-Received: by 2002:a17:902:284b:: with SMTP id e69-v6mr15333581plb.240.1526413567708; Tue, 15 May 2018 12:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526413567; cv=none; d=google.com; s=arc-20160816; b=b59Z2Hu14LW957zif2ggxvASDVFldZIai7ANbhyOSjX2OaKESPAMAgoilHsn+LyBN+ MemcHT6fPv5P+dqIdWT8+CeoiJ7w2R5rkR/Gt7d3P7aEP3k9fve3eIzpUEvpXrOdQ/7I U67hvVuuNh7AQXQiCDWYz6n4VmBqgdo5cnnjd3dsma81nJAg8fBtlad+tHUlHsBNEjQ2 h0X2e1HTwwrrQbY+jcS9MmOSQnZKp/3bhP5GK00EPkVMR+XZV9QysRRSxOxqZUgE47hj hL0lM3F99hg8GO3pfxVemf/6Cw0WuXqcffTOnBgj7M0HaXWpiUfoMEM+hLFnT/Ix57ps HYUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=k+lxWdeEwKJJ2jxkHviCKffTQivG3cCcCACmLm9eplc=; b=VIQAob8mWVqA8iqafJDXWRNXYsoT+qQ2nqbIOUu/nOnMjNdhUwwKdLjxTUQg846GUM ThQja8RI41k6GGEk3gFWNYRdAd+z5Che4VuQayQf4UsA5fVsrIUcU1Pxsh8ZpLe/sQ7H Xh5e2ItEtFhtFWVC4FNNF97mHkxX2La8APF4lqb57/x+N3z9vr9y5BdEamZP32mlE6Sd wzPzV2xlxW9gFg5kjCd0GqRrKbLS7vBVF88wILcRqDP2kaAhx9REpC0CB3PTEoK+2MLx cR8oasSjN544pdLNym1HtbOXiXm+aKYIDDpTFC+Bez+ENNoBRa7jAKnbT0oJnw4jcEUs ocEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=iS3tgQoR; 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=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 203-v6si813242pfc.21.2018.05.15.12.45.52; Tue, 15 May 2018 12:46:07 -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=@oracle.com header.s=corp-2017-10-26 header.b=iS3tgQoR; 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=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752076AbeEOTpl (ORCPT + 99 others); Tue, 15 May 2018 15:45:41 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:43430 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751104AbeEOTpj (ORCPT ); Tue, 15 May 2018 15:45:39 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4FJepCK136333; Tue, 15 May 2018 19:45:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=k+lxWdeEwKJJ2jxkHviCKffTQivG3cCcCACmLm9eplc=; b=iS3tgQoRKLdEZRI0prw6CuRnD6cEiJ7IqaK91aO1pCABuOmPWkwTgrmFZY7X0gA74Rw3 2h4YPPgqurTuJel9hnwAugctr3uqK5F2yueNjz/l7zZ0dcGU1qH+QwSBmwxU7nnNZx2H XdPbUqmsKvN3E1kOONT+BfBUUJRTkrvvDn9k0ABj3BpDEvvw+mBBOc/P7MEfra7BJPAu uT6vws2AARaEX/Fu6QRePHWC/bygynaioLFTWLgW/T2DJp6BuEsUf8qkWgXRNocnL/6j x9kdfl9P0UVL3ww+PqHThT7+15Ui43zToaGjEaNMnhYDieSK7Uc8fs3KvR3aRx9r79Q3 Rg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2hx29w1y9y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 May 2018 19:45:30 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4FJjTnt008510 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 May 2018 19:45:29 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w4FJjTEa011088; Tue, 15 May 2018 19:45:29 GMT Received: from [192.168.1.251] (/73.231.34.197) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 15 May 2018 12:45:28 -0700 Subject: Re: [PATCH V2] mlx4_core: allocate ICM memory in page size chunks To: Eric Dumazet , Tariq Toukan , davem@davemloft.net, haakon.bugge@oracle.com, yanjun.zhu@oracle.com Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180511192318.22342-1-qing.huang@oracle.com> <2797ac27-022c-0818-388c-e4a6131ad1ca@gmail.com> <1ded7d49-0ba2-3594-f840-74d7cf37a0eb@mellanox.com> From: Qing Huang Message-ID: <094279df-93c2-b06e-9f48-11be5cd78b69@oracle.com> Date: Tue, 15 May 2018 12:45:30 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8894 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=909 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805150192 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/15/2018 12:08 PM, Eric Dumazet wrote: > > On 05/15/2018 11:53 AM, Qing Huang wrote: >>> This is control path so it is less latency-sensitive. >>> Let's not produce unnecessary degradation here, please call kvzalloc so we maintain a similar behavior when contiguous memory is available, and a fallback for resiliency. >> No sure what exactly degradation is caused by vzalloc here. I think it's better to keep physically contiguous pages >> to other requests which really need them. Besides slow path/mem compacting can be really expensive. >> > Just use kvzalloc(), and you get the benefit of having contiguous memory if available, > without expensive compact phase. > > This thing _automatically_ falls back to vmalloc(), thus your problem will be solved. > > If you are not sure, trust others. Thanks for the review. There are many places in kernel and applications where physically contiguous pages are needed. We saw quite a few issues when there were not enough contiguous phy mem available. My main concern here is that why using physically contiguous pages when they are not really needed?