From patchwork Thu May 21 19:23:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 6458361 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C66079F402 for ; Thu, 21 May 2015 19:25:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC8AE202AE for ; Thu, 21 May 2015 19:25:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D72582052F for ; Thu, 21 May 2015 19:25:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752173AbbEUTZ4 (ORCPT ); Thu, 21 May 2015 15:25:56 -0400 Received: from mail-qk0-f173.google.com ([209.85.220.173]:33410 "EHLO mail-qk0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751702AbbEUTZz (ORCPT ); Thu, 21 May 2015 15:25:55 -0400 Received: by qkgv12 with SMTP id v12so64033291qkg.0 for ; Thu, 21 May 2015 12:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=I/jBAwh+kOHw/uCiErtXs1yA9HT8wtXuOKrBcGJaM9c=; b=C25+FI9Xs/+3dWyhvZiR/3Z8foevA8MZL/ATBBTiJ8Q3s6WxerdpuIGm4hreW3RTcZ TDZDmtTAYAfcU9I8ayWzVvmFHNUtwPJKll6GwQjDU4XhW+WuvwLRoxZqaX3sjVGM+9Gr EuPOwy0Dlz0u4FeaAU5BeKGzkhA3u9kkLsJn3RKQKoPpIU01oLohhPiWWOYsscHTbHW3 SokfqCLWXBI8w1iy/1xrjfVs3tu7KJkxfhG2+4NVXRt3gkzCWQDUu/B0wxeyJNXwlyS3 L5EzDi/iWa+Kh1t3GHuS9/6euCP0vFcdBoAo3tm2V/M/RZ6KvRC/miXdbwMoWW6G9229 sL0Q== X-Received: by 10.140.20.99 with SMTP id 90mr5941792qgi.87.1432236354754; Thu, 21 May 2015 12:25:54 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by mx.google.com with ESMTPSA id 64sm1309851qkw.13.2015.05.21.12.25.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 May 2015 12:25:54 -0700 (PDT) From: j.glisse@gmail.com To: akpm@linux-foundation.org Cc: Linus Torvalds , , Mel Gorman , "H. Peter Anvin" , Peter Zijlstra , Andrea Arcangeli , Johannes Weiner , Larry Woodman , Rik van Riel , Dave Airlie , Brendan Conoboy , Joe Donohue , Duncan Poole , Sherry Cheung , Subhash Gutti , John Hubbard , Mark Hairgrove , Lucien Dunning , Cameron Buschardt , Arvind Gopalakrishnan , Haggai Eran , Shachar Raindel , Liran Liss , Roland Dreier , Ben Sander , Greg Stoner , John Bridgman , Michael Mantor , Paul Blinzer , Laurent Morichetti , Alexander Deucher , Oded Gabbay , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Subject: [PATCH 30/36] IB/mlx5: add a new paramter to mlx5_ib_update_mtt() for ODP with HMM. Date: Thu, 21 May 2015 15:23:47 -0400 Message-Id: <1432236233-4035-31-git-send-email-j.glisse@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1432236233-4035-1-git-send-email-j.glisse@gmail.com> References: <1432236233-4035-1-git-send-email-j.glisse@gmail.com> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jérôme Glisse When using HMM for ODP it will be usefull to pass the current mirror page table iterator for mlx5_ib_update_mtt() function benefit. Add void parameter for this. Signed-off-by: Jérôme Glisse cc: --- drivers/infiniband/hw/mlx5/mlx5_ib.h | 2 +- drivers/infiniband/hw/mlx5/mr.c | 4 ++-- drivers/infiniband/hw/mlx5/odp.c | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h index ec532f0..ec629f2 100644 --- a/drivers/infiniband/hw/mlx5/mlx5_ib.h +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h @@ -569,7 +569,7 @@ struct ib_mr *mlx5_ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, u64 virt_addr, int access_flags, struct ib_udata *udata); int mlx5_ib_update_mtt(struct mlx5_ib_mr *mr, u64 start_page_index, - int npages, int zap); + int npages, int zap, void *data); int mlx5_ib_dereg_mr(struct ib_mr *ibmr); int mlx5_ib_destroy_mr(struct ib_mr *ibmr); struct ib_mr *mlx5_ib_create_mr(struct ib_pd *pd, diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c index 51a7775..759ed15 100644 --- a/drivers/infiniband/hw/mlx5/mr.c +++ b/drivers/infiniband/hw/mlx5/mr.c @@ -845,7 +845,7 @@ free_mr: #ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING int mlx5_ib_update_mtt(struct mlx5_ib_mr *mr, u64 start_page_index, int npages, - int zap) + int zap, void *data) { struct mlx5_ib_dev *dev = mr->dev; struct device *ddev = dev->ib_dev.dma_device; @@ -912,7 +912,7 @@ int mlx5_ib_update_mtt(struct mlx5_ib_mr *mr, u64 start_page_index, int npages, if (!zap) { __mlx5_ib_populate_pas(dev, umem, PAGE_SHIFT, start_page_index, npages, pas, - MLX5_IB_MTT_PRESENT, NULL); + MLX5_IB_MTT_PRESENT, data); /* Clear padding after the pages brought from the * umem. */ memset(pas + npages, 0, size - npages * sizeof(u64)); diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c index 5099db0..5171959 100644 --- a/drivers/infiniband/hw/mlx5/odp.c +++ b/drivers/infiniband/hw/mlx5/odp.c @@ -91,14 +91,15 @@ void mlx5_ib_invalidate_range(struct ib_umem *umem, unsigned long start, if (in_block && umr_offset == 0) { mlx5_ib_update_mtt(mr, blk_start_idx, - idx - blk_start_idx, 1); + idx - blk_start_idx, 1, + NULL); in_block = 0; } } } if (in_block) mlx5_ib_update_mtt(mr, blk_start_idx, idx - blk_start_idx + 1, - 1); + 1, NULL); /* * We are now sure that the device will not access the @@ -256,7 +257,8 @@ static int pagefault_single_data_segment(struct mlx5_ib_qp *qp, * this MR, since ib_umem_odp_map_dma_pages already * checks this. */ - ret = mlx5_ib_update_mtt(mr, start_idx, npages, 0); + ret = mlx5_ib_update_mtt(mr, start_idx, + npages, 0, NULL); } else { ret = -EAGAIN; }