Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp991717imm; Tue, 15 May 2018 12:09:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpouIbs2Z/ksNIRJBiHlfYclk5xViKz9PEPQhmS9QEZcPPLP7NgIkomKMZfXtqRCwOW1yv5 X-Received: by 2002:a62:fc8:: with SMTP id 69-v6mr16428857pfp.14.1526411342865; Tue, 15 May 2018 12:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526411342; cv=none; d=google.com; s=arc-20160816; b=pXJ2Yz/k/QBOinBb9IkWNz7mSae/4GQgS5NI8os4lvubAMn2XwjgzAyxwkfeA4ea+e unlt4k+LMK+IHUoGlXApFb9Ii9LDxkS3M6L92xCD1viuvCCIi5AcKWKRQREfsTNn+f0B Zfot0SGbP0kDPwKsKMDd2Bso5ockigFPxnol6tp6PszNhLBRhXO5mrordDawZl79siBn n6yx0ZfWi9p9Od+5625bXV98go6boYIWU0apRwlRqGK8+Q4kSgrkshOSaNiID34yFQis 6tJ2khgC4h8+jRvSbNb2d8dHDrvQc29+wUs3ogj2XCjXRKXBpdhRdwNgSR3l7Is4tVNv gUPA== 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 :arc-authentication-results; bh=Mo9wyUY08ed46M7R1QmRkvfCaZ216bBoiL3VfRTZ8tk=; b=PCeJEipI3I02GgP+Y+w37BckFBMM83CAeielZ5dW9lsXDlc/4VjJXB/jm3hCx8dssw YqihPfHCvir6HCjjYQ2aJE13grShI0DnFPb9OeM8BlsULyi6NoVQCR1jcEkBpVEiQ7md 8RJpLi/o7OUTfK6lWQ3trTFEAm5RrPgUXWtE3/WVySt4cNOeRGYtCjur2KuvnE3PiU1e Eb31BGzDiR5Xw0W3+7vfULjp0mUWgis1den8DcBtVhs13PHEIozd42JJv1foIBJY/n6b f8HSX/SbJMM/gHSyLS0PqiKsEE77KKs/sDF5kdaSnGSfeBvu3Yu5COvzSuRMqGpPEEe6 S3zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H4DFvyJj; 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 b1-v6si656819pla.570.2018.05.15.12.08.48; Tue, 15 May 2018 12:09:02 -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=H4DFvyJj; 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 S1752643AbeEOTIG (ORCPT + 99 others); Tue, 15 May 2018 15:08:06 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:40050 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751859AbeEOTIE (ORCPT ); Tue, 15 May 2018 15:08:04 -0400 Received: by mail-pf0-f193.google.com with SMTP id f189-v6so507633pfa.7; Tue, 15 May 2018 12:08:04 -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=Mo9wyUY08ed46M7R1QmRkvfCaZ216bBoiL3VfRTZ8tk=; b=H4DFvyJj79ffgK0XG5IWL0nluyRf+VeVFwu9bOtwbsn7XEh7ishf+GBOWvHX36u8La RRUp8YTeFZjj0mJP3HxjpGLyKVi4N2a2HLUh3bqRiwT8XZ0Ym9BouO3VDkp3MIwRXhof 3DAPK1r1ThP5yyJfW2uK7cDZBpQut7TZq24vWt29UZlvOTGQieKh36q2RgxPPkjzf1XW 4q6TQ1yfasTkDOncJcwPgZxRT/N7Wj6F+iAfIypC9BhHRe5hNAN5o1J2sR9b1hjdq7DP 1I23+XYiwSF6Ewd0BiHmLLXZcxXQnLXopT01iKbWd/pYLRKmp+awtLbbtRvj74Y8lKst 8rbg== 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=Mo9wyUY08ed46M7R1QmRkvfCaZ216bBoiL3VfRTZ8tk=; b=k3Ov8BBI0F/XFfEW/+PE9/uqPjGclMofMEivh/xNlBPQzVisMw3PvcvYQNPqlQTTGa RCukcl4ISNzu8SX9SI5RePJyD20jCw1491iZcV1lSYRH+cwn6yf6NFLMAywaCmjhUjvp NKbeMMAoNOkBUhRm1su2od+16xRMtt6H5XKQV/pCgTPTlngHIpugEcwNe1RsXn40sJvn luEPTy/pPZbIoOMh12gs0M7jTY+oSJpqWL9xJ+q3ef9xxG4NqKF9o7mQLkgQ0RnraTT0 7JfK3vvDAiNKhndVGBeiCCkAmcDsTErhNRpmn3xdYP4lQ15ROQeT9WzLv9XEPr0hkJFQ VzEg== X-Gm-Message-State: ALKqPwf1d8khYNIWKP75ScqX4hPFjW9gTtPH/pWsKKBxiTvhJh4kaH8l MggDQjQlf5GWlUY17j9fAqEKy96X X-Received: by 2002:a62:c103:: with SMTP id i3-v6mr16367772pfg.148.1526411283439; Tue, 15 May 2018 12:08:03 -0700 (PDT) Received: from ?IPv6:2620:15c:2c1:200:55c7:81e6:c7d8:94b? ([2620:15c:2c1:200:55c7:81e6:c7d8:94b]) by smtp.gmail.com with ESMTPSA id j11-v6sm636005pgq.83.2018.05.15.12.08.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 12:08:02 -0700 (PDT) Subject: Re: [PATCH V2] mlx4_core: allocate ICM memory in page size chunks To: Qing Huang , 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: Eric Dumazet Message-ID: Date: Tue, 15 May 2018 12:08:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.