Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp374310ybb; Fri, 3 Apr 2020 04:30:22 -0700 (PDT) X-Google-Smtp-Source: APiQypIdZPaGIYEJMp8sKoFAzfGKFJbPyFJzDpE0SNy63/r9dydah2hHOhojppoODf6nWrvMStY/ X-Received: by 2002:a9d:58c:: with SMTP id 12mr626940otd.156.1585913422822; Fri, 03 Apr 2020 04:30:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585913422; cv=none; d=google.com; s=arc-20160816; b=Q5M/nE+ypd6jx2S910X6RQ3z+8W3E/FHsV3mbBjVZsuOjzigf9jdEn4bgni1cj3IY2 J9gGon+h+z//8QiqF7Q3UPzcjd8N3agZK86nXce5N/5yr6AJHLk/ZEvReUXLl3GU3F1X 4w5Q17jZ2l0cMnQvecJYqpw/aRdB2aTEICSIu5AbWjcC2dIg/g4ZvvtvbW8sTxMzeYxE iu/Xxjy1EujZbb8Y1PxXfaTGKDjWZPwsqKkzF9v+ceHJV8PVKmgS79VeeZV4oD9/EZsd AK8/la2gw/IIsDQWBCKyzNUQKim0wd7/phvdjb6Re9hudomJsxFfMwoWPsrAuf9kuRhi rxwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mAGZx/EGSI/RDjikjycvglo1xEb2tWim3LCqQGVnzJI=; b=cXRw1OT98ItvoUqZDYGnABrTdC2fwxcWR+i4+xkvIpDCeKujDtwE31wAm+9fRCNBWE UODjpzGCrd00hXahQZ2JFxaPmlvV8dyPdOWy3tsLk1y5esmi0YHRJXCMYq5xgULE8d7y MVPI6mwuTmuu33taM9HnaKIZqgXaxBNeSS56JQ0gujZAvk8LCCoL97pO7t0wRdNvHnsW UXdkURYyKPjGbXc6DFvHQfA9B+pD0sr7vtqSUl1tLjaaztqSpXu2WEODywxUvNHXK8tT wZ3+BFl6z21zstdttVhYEkMBvzpw1UBYKiPxOxYfbeYf87rhXDk9XRVdfHQS84nRVY6K ofvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b="x0yHw6L/"; 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 c133si3771063oif.272.2020.04.03.04.30.10; Fri, 03 Apr 2020 04:30:22 -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=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b="x0yHw6L/"; 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 S2390768AbgDCL3m (ORCPT + 99 others); Fri, 3 Apr 2020 07:29:42 -0400 Received: from mail-lf1-f49.google.com ([209.85.167.49]:45974 "EHLO mail-lf1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727927AbgDCL3h (ORCPT ); Fri, 3 Apr 2020 07:29:37 -0400 Received: by mail-lf1-f49.google.com with SMTP id f8so4118104lfe.12 for ; Fri, 03 Apr 2020 04:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mAGZx/EGSI/RDjikjycvglo1xEb2tWim3LCqQGVnzJI=; b=x0yHw6L/NgJHQg6clxAQ3NicETBimmrGkxc5bhLtUTHIZZ6gdjrI89zcBBRayGoUir 7ufdkT4qvJVe+kOZvQbza2ILOMRGvZLR8jyJ1EKVJVN5VePrJVVG9hKMEjkhfUj+6p30 cm6cVLDe1QxBjGcUYoMnxWjf3bfLuxj/jPNPguI1Akb5WzqU3t+fnrXihgwP/ppUph4A CT3L4rtI5GFKkmcmzxY7uLbnZDFQfWFqto6O/7V/qNfsjFmHmj+ow7Eikvk0jTBposlE HYt7MTTbT/vjnMgOVp6OtXYFrpQClrjVosE22wjvOGPykQyxB03RFBVO3UNwtMK4WO/z GT6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mAGZx/EGSI/RDjikjycvglo1xEb2tWim3LCqQGVnzJI=; b=aMNCZLMjqUo42UQyHEVrqijtR+frOueFBS57NkBAkscmOUcGKIhvo8LSNZ9o/R6+nG P+92P59QHGSDR090uVhWjz9S6z8LNVpHCwi94TBekoQmeyKqSb7EHrWqyKseEnJ6ou8u 9jp8444QivZWuLasWEuxjqNAkwI7dqjICOk1AXXh8vMd7T2rk+UhcR3yPRdhA7xZ1rep /j7uSbOKWZ7RjeN9ALCdl6hPe+cBkm9lQHu6elYSatUOQaUz1dEE72Q1EpkqcsyTHwA8 8TLovovRNN/6N5R3dy8o1tmRVkmAduNOQ3WErWDqcLJZkSgNjob9HIrAnQDjy7DmbUD4 6gUg== X-Gm-Message-State: AGi0PubaFQFIC0is460cgEaKYAkNyVG5v39h+bTo+Sw2EbFWMZGUQvbm m3SGP1EQnqvSX2lItqhqkNEPBA== X-Received: by 2002:a05:6512:14a:: with SMTP id m10mr688758lfo.152.1585913374487; Fri, 03 Apr 2020 04:29:34 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id p14sm3202760lfe.87.2020.04.03.04.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 04:29:33 -0700 (PDT) From: "Kirill A. Shutemov" X-Google-Original-From: "Kirill A. Shutemov" Received: by box.localdomain (Postfix, from userid 1000) id 78D6B101332; Fri, 3 Apr 2020 14:29:31 +0300 (+03) To: akpm@linux-foundation.org, Andrea Arcangeli Cc: Zi Yan , Yang Shi , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCHv2 4/8] khugepaged: Drain LRU add pagevec after swapin Date: Fri, 3 Apr 2020 14:29:24 +0300 Message-Id: <20200403112928.19742-5-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200403112928.19742-1-kirill.shutemov@linux.intel.com> References: <20200403112928.19742-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __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 fail due to the extra pin. Drain LRU add pagevec on sucessfull swapin. 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