Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3293905ybb; Mon, 6 Apr 2020 06:12:16 -0700 (PDT) X-Google-Smtp-Source: APiQypInRVulsqgjdWZu1Civ8ONBw//ezTHXRJR11H/R4JQ3B61GoXu7x2ClQYoyHgo1UFACbsbt X-Received: by 2002:a05:6830:168c:: with SMTP id k12mr16988301otr.366.1586178736204; Mon, 06 Apr 2020 06:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586178736; cv=none; d=google.com; s=arc-20160816; b=RUIqcAhRwDbQ8dsIQtlWPJGsgA1TALShMaf1clxABpOWb0SsRKgZEjk50L74vokZuI qz43wEWraV/Of9Nb50DYAmLTKmpLlzzUPh4KOBFp3EggFMMB1s97j6onqeI7RArJkGb3 hDGrRm+a9HEIGw5bRVFJskZT4sC8Wcy1hV8w0hLfnNjj92CXg6qK/rbHAzE/ypoXVHXq 42hbt0xH80jHyLn/0ngNxMgVnAC1+TxrdRNiLB4Bc3/rZJGWCCDH3ToSQV8j02v/V1Al nzsUFF+XhRPyHPhce0Kkmk7x6oENdD+zxRBo6O8IqN/ZLWZsPU//WazoJxXSbMakJ1RC m1Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=QhAGqQow2xf9gnlQ1LeKiIdjJMWRPSwZu94uUdZ5Lv8=; b=XuSqMrod9gKsQ0wOe1/bgpwwtc/bl1IGavF0ORw9e4JyFf3C1WfC5onkeOCf898Loz nIoRpv+usJu8r374bVlh0gyQhkyfrrynmL34PCS3HBThBlzeMO3nvZIoEw0GeyaPGYt0 5FczGpqhOGK5lJfL0rnhqdAfarvtbplKiKMB9gIMtEAd2ZNByWYvQ6//1HLa2fm7+HcN yf4i5pNvdGzVyd24iZ2p/F48+nAbw73a9TfU+P0uFB+GOq3UtlOjaZulXJ6iCoKUPPXi CERywsv0I8R0P//N4fdUtfyRt5R2eKVrbouuW/36i/KJ0DTLhe2c9PdwT2MwwB7t/HWg dVow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=XvOfKEqf; 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=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21si7331375oia.257.2020.04.06.06.12.03; Mon, 06 Apr 2020 06:12:16 -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=@nvidia.com header.s=n1 header.b=XvOfKEqf; 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=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728348AbgDFNLc (ORCPT + 99 others); Mon, 6 Apr 2020 09:11:32 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:11392 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728018AbgDFNLb (ORCPT ); Mon, 6 Apr 2020 09:11:31 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 06 Apr 2020 06:09:49 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 06 Apr 2020 06:11:30 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 06 Apr 2020 06:11:30 -0700 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 6 Apr 2020 13:11:30 +0000 Received: from [10.2.163.253] (172.20.13.39) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 6 Apr 2020 13:11:29 +0000 From: Zi Yan To: "Kirill A. Shutemov" CC: , Andrea Arcangeli , "Yang Shi" , , , "Kirill A. Shutemov" Subject: Re: [PATCHv2 4/8] khugepaged: Drain LRU add pagevec after swapin Date: Mon, 6 Apr 2020 09:11:27 -0400 X-Mailer: MailMate (1.13.1r5680) Message-ID: <592329FA-69D0-4801-A5DF-F9CC8A3FE305@nvidia.com> In-Reply-To: <20200403112928.19742-5-kirill.shutemov@linux.intel.com> References: <20200403112928.19742-1-kirill.shutemov@linux.intel.com> <20200403112928.19742-5-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To DRHQMAIL107.nvidia.com (10.27.9.16) Content-Type: multipart/signed; boundary="=_MailMate_C83B2B7B-6470-4A8C-8DF4-B63554AB4EDB_="; micalg=pgp-sha512; protocol="application/pgp-signature" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1586178589; bh=QhAGqQow2xf9gnlQ1LeKiIdjJMWRPSwZu94uUdZ5Lv8=; h=X-PGP-Universal:From:To:CC:Subject:Date:X-Mailer:Message-ID: In-Reply-To:References:MIME-Version:X-Originating-IP: X-ClientProxiedBy:Content-Type; b=XvOfKEqfNNOwCwscu+tUNJB3/812aq7VuEM+uFSpu1FKVXJfUeIM8uPIcx+Viyz6v hgfV4fibPMtQfUz7hprNtlKr0ACsRR9Wmiuzy2AefSfgnHbZrDFEi2BCDaMgXUwNxf BA1TS/U6aDv+K5lC5OKoyJiXnBLHuSGx8V9IoIrtL9CHLIANDph5c0le5N6V533ZmF wqTxXyZr26ZjuEwhJ0k2yKObpYdeqbBv5e30MTtQAEsXa58kWYyjI5s/0KCJtvk7M+ 2uKzKv58mHlf8wgNNrNEGZauIfcSwg1mkLhlO08KX3+m4EK7z4KLQzkozpFtLoar55 x4KvzevsZU5Hw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=_MailMate_C83B2B7B-6470-4A8C-8DF4-B63554AB4EDB_= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 3 Apr 2020, at 7:29, Kirill A. Shutemov wrote: > External email: Use caution opening links or attachments > > > __collapse_huge_page_isolate() may fail due to extra pin in the LRU add= > pagevec. It's petty common for swapin case: we swap in pages just to s/petty/pretty > fail due to the extra pin. > > Drain LRU add pagevec on sucessfull swapin. s/sucessfull/successful > > Signed-off-by: Kirill A. Shutemov > --- > mm/khugepaged.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/mm/khugepaged.c b/mm/khugepaged.c > index fdc10ffde1ca..57ff287caf6b 100644 > --- a/mm/khugepaged.c > +++ b/mm/khugepaged.c > @@ -940,6 +940,11 @@ static bool __collapse_huge_page_swapin(struct mm_= struct *mm, > } > vmf.pte--; > pte_unmap(vmf.pte); > + > + /* Drain LRU add pagevec to remove extra pin on the swapped in = pages */ > + if (swapped_in) > + lru_add_drain(); > + > trace_mm_collapse_huge_page_swapin(mm, swapped_in, referenced, = 1); > return true; > } > -- > 2.26.0 =E2=80=94 Best Regards, Yan Zi --=_MailMate_C83B2B7B-6470-4A8C-8DF4-B63554AB4EDB_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEh7yFAW3gwjwQ4C9anbJR82th+ooFAl6LKn8PHHppeUBudmlk aWEuY29tAAoJEJ2yUfNrYfqKKxYQAIDwUi/sWEd4E5TrOi0JeGwSlI9dP3EFZQPt joKck2BSsIirc6FgoyDMhOmstJ422Qa44vbD1eODystiAPJr2Kiv8QPGeKWBfWP0 jt6cnItoFE03xHxXw6sTjrM2LVMpjowgb6jcoHzI11QCi6GLcVTxyYJrA2pFuBhJ 6+Ku8ur5IHsLm1SQv3e6kmvdbrRWLyAe898CtGOuqJz7S1/sC69lK1lkc0PLGwDP XhMxxwcgVnVMG5zouRHnGkMZ/GnIvxvkgcGe4EXVGTQXpB3Whbgw4wtzEOl3SHW9 RmRxNGREx3R5mfUwzidrPRjFPPKGMCkmNHwjawVYyViENPuH+uMZsx1p7TtrcefR dFbUESbNowbd3r1DD0n1fbN/9QeMnTZTJorRNl7dZdYe5txB0AvBBhHSJCmcw84C YyZ/wRpC9xv86FXuW4letu2H/J0zUJii/lQyanUWT1CorOzEi1nwRBm0iHQi2alM 0eCqxM5VyuEuhyfUAddlegZST1iL6ouVu4X2sZ6vUAXKtXgtggB0xFkyuDSw8J+e a35pwnDJroqOFVImtZh+sfkq//ELFU4djvY+q2imm6pzoUgepCptAT29Mx9VbdOb NgGl/SSSZ1GpayWTr0J27s+bBgadoseAV5BaB1dJzW3lFjZj5poRiSTSJ8EfY7Gf Bz/36+gY =q3D5 -----END PGP SIGNATURE----- --=_MailMate_C83B2B7B-6470-4A8C-8DF4-B63554AB4EDB_=--