Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3812388yba; Tue, 23 Apr 2019 10:02:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxiXDTRq2xW/63MfEKfvAjouRcq1KVOCd/P9NWJD2KsMysEkaU9lWCAiSAg9tG8lDTg8h83 X-Received: by 2002:a62:1c87:: with SMTP id c129mr3148903pfc.113.1556038945896; Tue, 23 Apr 2019 10:02:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556038945; cv=none; d=google.com; s=arc-20160816; b=ESibNDKg0tM4Hv9Ky7dG5ct4prZFlrRDkbAypI3HSi5JdEKJVV2LYM2LMq0EhHF1vW IWirTEEMQxWl6ggOiOwJh52AJ4dTrzJHkkcNVhEgdXXsJ3xGLETGhWVFw/5PITolRrc4 d95Tlp5fnFvF/sWGaJdVLuTIsF1J1WATUCbKVVs/SvtwecATDfURf5xmOBGZUTGp8QP2 WsjLOHdoF/bUGEyeSWJkoXghW5LzE59wXODMIm75x0Fe41CjSIWryePQq+ryGr+jiCzA 7zpvRuQYmzKl7Hjn5JJNVoregKl+gH3nv75wdowYBW7LYWDc0AjGmlkS+6B61Fa+bIy5 pZjw== 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; bh=LG+CJPDrLvZOBj1AUk8UxW2sW9hULxqeC4o9OSe6AbE=; b=MlZ0Doy5p0eftsaql0lxE1CFZSuIFGM8pmAWlq3pPOpJWE14wV0bK5yY+XFx5r1xps jCRNKgFPgjZdG8i0+73HKS3Ch5nJK5L3Wy/uAMg4DegTGIsA++Uwg1h4r+pox0iuqLkO Kua8BDp1fTmamqidnBdP7N4rXUT6ZC5pPsqnsrAZz7FrFyeD+IUW6to6n0gRWN7dzUwa dB3MtzFqXi3pvInEtTbJQf+ZGX8URtxt76+RXrhnpkIG+HqrCy8+exl+AGB4oElwA87X L3sQISoS6uoj+miV9VnEiqS2Sp9yZrQ1VdOXU135Id5TdtlLE7ZLMztbdOWA/u0l3WIs 9Grw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b65si18471598pfg.120.2019.04.23.10.02.09; Tue, 23 Apr 2019 10:02:25 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729223AbfDWRAc (ORCPT + 99 others); Tue, 23 Apr 2019 13:00:32 -0400 Received: from mga12.intel.com ([192.55.52.136]:30818 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727740AbfDWRAc (ORCPT ); Tue, 23 Apr 2019 13:00:32 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2019 10:00:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,386,1549958400"; d="scan'208";a="318293329" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by orsmga005.jf.intel.com with ESMTP; 23 Apr 2019 10:00:30 -0700 Date: Tue, 23 Apr 2019 10:00:44 -0700 From: Ira Weiny To: Stephen Rothwell Cc: Andrew Morton , Michael Ellerman , PowerPC , Linux Next Mailing List , Linux Kernel Mailing List , Alexey Kardashevskiy Subject: Re: linux-next: manual merge of the akpm-current tree with the powerpc-fixes tree Message-ID: <20190423170044.GA30084@iweiny-DESK2.sc.intel.com> References: <20190423190606.0fefb856@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190423190606.0fefb856@canb.auug.org.au> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 23, 2019 at 07:06:06PM +1000, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the akpm-current tree got a conflict in: > > arch/powerpc/mm/mmu_context_iommu.c > > between commits: > > eb9d7a62c386 ("powerpc/mm_iommu: Fix potential deadlock") > 7a3a4d763837 ("powerpc/mm_iommu: Allow pinning large regions") > > from the powerpc-fixes tree and commit: > > 02f506bad7af ("mm/gup: replace get_user_pages_longterm() with FOLL_LONGTERM") > > from the akpm-current tree. > > I fixed it up (see below) and can carry the fix as necessary. This Thanks Stephen Looks good for my changes. Acked-by: Ira Weiny > is now fixed as far as linux-next is concerned, but any non trivial > conflicts should be mentioned to your upstream maintainer when your tree > is submitted for merging. You may also want to consider cooperating > with the maintainer of the conflicting tree to minimise any particularly > complex conflicts. > > -- > Cheers, > Stephen Rothwell > > diff --cc arch/powerpc/mm/mmu_context_iommu.c > index 8330f135294f,755fe7adc0d8..000000000000 > --- a/arch/powerpc/mm/mmu_context_iommu.c > +++ b/arch/powerpc/mm/mmu_context_iommu.c > @@@ -135,27 -144,18 +131,28 @@@ static long mm_iommu_do_alloc(struct mm > } > > down_read(&mm->mmap_sem); > - ret = get_user_pages(ua, entries, FOLL_WRITE | FOLL_LONGTERM, > - mem->hpages, NULL); > + chunk = (1UL << (PAGE_SHIFT + MAX_ORDER - 1)) / > + sizeof(struct vm_area_struct *); > + chunk = min(chunk, entries); > + for (entry = 0; entry < entries; entry += chunk) { > + unsigned long n = min(entries - entry, chunk); > + > - ret = get_user_pages_longterm(ua + (entry << PAGE_SHIFT), n, > - FOLL_WRITE, mem->hpages + entry, NULL); > ++ ret = get_user_pages(ua + (entry << PAGE_SHIFT), n, > ++ FOLL_WRITE | FOLL_LONGTERM, > ++ mem->hpages + entry, NULL); > + if (ret == n) { > + pinned += n; > + continue; > + } > + if (ret > 0) > + pinned += ret; > + break; > + } > up_read(&mm->mmap_sem); > - if (ret != entries) { > - /* free the reference taken */ > - for (i = 0; i < ret; i++) > - put_page(mem->hpages[i]); > - > - vfree(mem->hpas); > - kfree(mem); > - ret = -EFAULT; > - goto unlock_exit; > + if (pinned != entries) { > + if (!ret) > + ret = -EFAULT; > + goto free_exit; > } > > pageshift = PAGE_SHIFT;