Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2993308yba; Sat, 11 May 2019 01:12:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwP1yn0NpRPbvH6qZwpFFKUKewsVvzBI5+Fxu7WmWHN9LBJSd5S0LyQrIG6o6cBkOk5PiOu X-Received: by 2002:a63:7982:: with SMTP id u124mr18823364pgc.352.1557562338079; Sat, 11 May 2019 01:12:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557562338; cv=none; d=google.com; s=arc-20160816; b=g1ndzJQFqLPLDawBsqFSsI4Gbm7NWOnOApekbD2BSq35CvsV8Di+Q0fFY3VKifihD3 FCvmgMaylZSpUcTCv5cDQNjKusPz97C8OeDUefHuwzNIZ3Zoy6DsXViAVzzBI1WjsETv aoX1eiMZFAIp9XnTE4FTYSiL8udI682+KhoNPyHqJbxzyiurNJdQB+DrG2Y61dC/RoLd E1mq4RAmuk8XLlZlDgCg1xQeYtQYqfKpLd/6J1q3UPzsZPTiP6CCUFetQ1BbsW+6f+K1 F6cWkRqmWgGQ0NFMcKoOSiGs57eKblNb/nJWjGq4zNSmtmISpaDEv60BEcXpQ0pDoDki mnLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=TQtZc3FelJBQESxVUuXzQ1cko0sOiYknE7Ka8Kps1YY=; b=vxee8e0CRuTj3WKCejQVv1/32pSp/gt4ZnT8M1xNpkwrnDKauDdt7BnU7x4DWE0ruZ 51gMlIas5UjxAAmxG2BWdNXxien8Mz4//WwovH+rETzCvkznfRRA9IRfUz90+B9b+/TP ze3Q7f6O5Bw4HwD6Mmx9bjHrMpdouoScoz4gAe4BxklL9yARez04Frm3+52qtabAla9H i9/q264i6P3F6f31nSraSQHtmydL10Q+6N4aoplldXMghmubEod8z6kU8eXpJmThfKru gXjUl9UoGzaQTw0li0lZnFKYup3uk4bXrDl9vIShXUNV6UB2CIAsvN8frk61p3uzvKTu bh0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=al5AmLsP; 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 o14si9466062pgv.74.2019.05.11.01.12.01; Sat, 11 May 2019 01:12:18 -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=al5AmLsP; 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 S1728452AbfEKILA (ORCPT + 99 others); Sat, 11 May 2019 04:11:00 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:34283 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728424AbfEKILA (ORCPT ); Sat, 11 May 2019 04:11:00 -0400 Received: by mail-lf1-f67.google.com with SMTP id v18so5728578lfi.1 for ; Sat, 11 May 2019 01:10:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TQtZc3FelJBQESxVUuXzQ1cko0sOiYknE7Ka8Kps1YY=; b=al5AmLsPkWUP0wa7q0iB6soqaQEuPYfX4SBDqvRrM0p/UG1oSWSpI4uNt/e02ZYUJU ahKoI6IbQiLLSO2qJNCJ+iLlPoZiBoqJ7Y77f3M1n/ssjjspcwc+BLvCwnyoDdd+2i5X B4bb4q7z832ZXkXDdErEgNiR6qZGw0NySHHYrvkbmHApj8T48VHfhQ2NpHlUIax39SuG gjtzq0os4UsjlL3tNwLrSLeXPcYM6zyUJEJheNKUCzLtCiTOPdet5sIRf2LijH/mcb3M +B7XJ+y2W2dsTnKRaGxST00J5dhR7uYmSLk4T/T1/Mx2gI8Namq4U7SRp5w1l/QFp9+U hWAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TQtZc3FelJBQESxVUuXzQ1cko0sOiYknE7Ka8Kps1YY=; b=gxFN2v/YuwyBKtY1wiwi0Sfirk4H6sUtn8n9lI5Dxf2xVLv0mqX5A/MqEwD0Kp92Ic ZWsTdOBUGDx54hZXugFS6KpgJADqPDdl0Md7KudM+dz73vtJQSjtLnjN90pjkaySqWch AzXK+ekLFI3Tnh72R8x5/dUJ7fAAjrvIF+gSS3IXncjluag896EVPd6PjsmBQTe+Rzcg eyKf1S1GYiT+pLrnBP8ziZJ52ViP/xk859koYqhVkpjwGGxS0PZwvsAu7BbcJ3tEa+aG fwPp3qiXNl4ZdfVMNk3mgecFSODvSmgTgk6pduzQw89FpC1XUVuHkSOP0e/AX8DUPoFO rA7g== X-Gm-Message-State: APjAAAVQx2DPJYrOdBK8/zTQ2i5GmOTuoSu9rX6h71gID/yXEDiOx5QS ONgDnJnJJUSVRgyGg/q+Vlc07xG5nqjSlXJLFqlWLQ== X-Received: by 2002:ac2:5621:: with SMTP id b1mr8593193lff.27.1557562258490; Sat, 11 May 2019 01:10:58 -0700 (PDT) MIME-Version: 1.0 References: <20190422103836.48566-1-swkhack@gmail.com> In-Reply-To: <20190422103836.48566-1-swkhack@gmail.com> From: Souptick Joarder Date: Sat, 11 May 2019 13:40:47 +0530 Message-ID: Subject: Re: [PATCH] mm: Change count_mm_mlocked_page_nr return type To: Weikang shi Cc: Linux-MM , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 22, 2019 at 4:08 PM Weikang shi wrote: > > From: swkhack > > In 64-bit machine,the value of "vma->vm_end - vma->vm_start" > maybe negative in 32bit int and the "count >> PAGE_SHIFT"'s rusult s/rusult/result. > will be wrong.So change the local variable and return > value to unsigned long will fix the problem. > > Signed-off-by: swkhack > --- > mm/mlock.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/mlock.c b/mm/mlock.c > index 080f3b364..d614163f5 100644 > --- a/mm/mlock.c > +++ b/mm/mlock.c > @@ -636,11 +636,11 @@ static int apply_vma_lock_flags(unsigned long start, size_t len, > * is also counted. > * Return value: previously mlocked page counts > */ > -static int count_mm_mlocked_page_nr(struct mm_struct *mm, > +static unsigned long count_mm_mlocked_page_nr(struct mm_struct *mm, > unsigned long start, size_t len) > { > struct vm_area_struct *vma; > - int count = 0; > + unsigned long count = 0; > > if (mm == NULL) > mm = current->mm; > -- > 2.17.1 >