Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6523273ybc; Thu, 28 Nov 2019 00:34:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxbzK2KeTatC48py08SXLm2cMdF0GttyMyl/Ly0KloyWYUnfDo32OS1bbZijcMJ15PlBGYC X-Received: by 2002:a17:906:5786:: with SMTP id k6mr53396952ejq.294.1574930058746; Thu, 28 Nov 2019 00:34:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574930058; cv=none; d=google.com; s=arc-20160816; b=AiUPOYlVVjMp4hzQAUqeFVDRrT9kL5qxND02Fnb+0f2tWbxuIDdJQt2T4Mygex6zry MV4GtiBrCsPdeS0mU67ppD7hlkyNdeJkjPLj94bWcsxbsSShG6xdPkJ5xjb0PB2DgXnM +1fe0B9smyXt7Yim4toe3qRWE3RpLZWwe/25qVoH77bBzoSWCW2q8pDZ8upSHl0M3/4v saLgVBLZNQlWC7RQUpQy0qRxxCk/cfCeyCOk2zmvf9fPvy0X5V64r8hr2tCRaJWxY83K rtx6b4NpqAzwCo09uiSP5lVJtuVqkS77sdyz8bzj+ix0aonJ4xo5RuqFnRzUCIuerIln xmuA== 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:dkim-signature; bh=ngIzBSaZTBdMqXGWOPe9GclRnKYINQpAHzSYxgt3Z4Y=; b=KoNnl1TwGsCakOOJwgJ689IrKbNrRIEy4T8LJlC2m4IUkQS+ZI/7xR1NlgAvNUzwIJ mXgNBuSNR0a/OHTzHV58oBlJezseRG52Oda4Uf18RIxGuY75H0T5UGHnHwrJMXS/etK3 QTrHs1ADt3EvffVelKOFkcp5NZmeMdTCUd35fTRdN7oPSAbEFZq2Wr1CHUUUALCbjHoZ FCvAa4xYIG7CTUE4te22mp+bv5I/9nxTbzoPwjYdVcqmWaCLHxdBFsRGRQrWUazGeEM5 H0IKzesY+yy6sH5+hL/TR2yBrpnW2Hm86NIYAC7hQ5/0Z27ihzsrFvrJ/QYd0SbJy4fY qW1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=uPGBabdr; 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 h12si11010070ejf.418.2019.11.28.00.33.54; Thu, 28 Nov 2019 00:34:18 -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; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=uPGBabdr; 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 S1727534AbfK1Ibs (ORCPT + 99 others); Thu, 28 Nov 2019 03:31:48 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:44727 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727184AbfK1Ibr (ORCPT ); Thu, 28 Nov 2019 03:31:47 -0500 Received: by mail-lj1-f194.google.com with SMTP id c19so494188lji.11 for ; Thu, 28 Nov 2019 00:31:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ngIzBSaZTBdMqXGWOPe9GclRnKYINQpAHzSYxgt3Z4Y=; b=uPGBabdrg40M2eyaJnEIdzAkPAWAh66yboW71srLcihQEm3evrrLv74wXfV/y0V4vy zE/5pxbcMDSb1+4rtp1KpfxSCBM5IxnfAXZUnmZpBcXTFpLEv+9cXKxZbN0hqsTIuchd stcvU4DC7L3G2Y+HUlF8Qa7lC5LTD5RcGAB5Yxgk7W2ZzsLazJrIy7DArw/KamasuYuc ZP6uN9UEfkQfaHhAi1s7cd6epkq/kl6vd/sfaiYoNWbucL/y0c9caw50APZ8YKXkcb9p E1r9Ij0lC0+jumkCzaG1osQeFg7kxsC2RkGlhkx51mfDWXOyoqq5hd2zal85x52Zmz9P 5/zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ngIzBSaZTBdMqXGWOPe9GclRnKYINQpAHzSYxgt3Z4Y=; b=Ho+5NKNKvlcQl0N03HSULKr5yhNnOv2MyCl7FCAIr3Q31IgmRBQCPzOrZ1W1TF4seu FJN8D3H+B6OjRbzuUPseozJ22SDBj7DwCyycJBhKEKpzEd1Wx8vJfdwyIkwyCtU0VU29 G4sV9tgsm3w1bgVR9REqhlJv6WwDrV+PSbFntZCEL/3Zt+ZhYA3ZMu++MzrHecx7FVFa tLL++sq1SuvoYvl8pTh3UMAyq/hO9jrCd5mAggj0qE+V7QlSG8Fr4v+ieJv87KGJNtoN oKBSrCy15d55pICl2dBXit2493IOhPDvwraJgx4iKvJHjK++Bz0Of9OQ67bD5+3xKyUJ PINA== X-Gm-Message-State: APjAAAWfz8AT8aWrVkinKEJdIZ7AjHh78HlAzHsQbOkH80FAsGC+pcJg 3DNMTmswCikvg6qxE9keNzymnw== X-Received: by 2002:a2e:888b:: with SMTP id k11mr9117296lji.87.1574929905389; Thu, 28 Nov 2019 00:31:45 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id s11sm8207800ljo.42.2019.11.28.00.31.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 00:31:44 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id C25C6101715; Thu, 28 Nov 2019 11:31:43 +0300 (+03) Date: Thu, 28 Nov 2019 11:31:43 +0300 From: "Kirill A. Shutemov" To: Wei Yang Cc: akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] mm/page_vma_mapped: page table boundary is already guaranteed Message-ID: <20191128083143.kwih655snxqa2qnm@box.shutemov.name> References: <20191128010321.21730-1-richardw.yang@linux.intel.com> <20191128010321.21730-2-richardw.yang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191128010321.21730-2-richardw.yang@linux.intel.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 28, 2019 at 09:03:21AM +0800, Wei Yang wrote: > The check here is to guarantee pvmw->address iteration is limited in one > page table boundary. To be specific, here the address range should be in > one PMD_SIZE. > > If my understanding is correct, this check is already done in the above > check: > > address >= __vma_address(page, vma) + PMD_SIZE > > The boundary check here seems not necessary. > > Signed-off-by: Wei Yang NAK. THP can be mapped with PTE not aligned to PMD_SIZE. Consider mremap(). > Test: > more than 48 hours kernel build test shows this code is not touched. Not an argument. I doubt mremap(2) is ever called in kernel build workload. -- Kirill A. Shutemov