From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E348FC433E0 for ; Thu, 28 May 2020 08:51:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A9CC820B80 for ; Thu, 28 May 2020 08:51:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="uGcFgkay" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9CC820B80 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5349C800B6; Thu, 28 May 2020 04:51:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 509BD80010; Thu, 28 May 2020 04:51:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 42085800B6; Thu, 28 May 2020 04:51:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0039.hostedemail.com [216.40.44.39]) by kanga.kvack.org (Postfix) with ESMTP id 2AA5C80010 for ; Thu, 28 May 2020 04:51:49 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id DB5E0824556B for ; Thu, 28 May 2020 08:51:48 +0000 (UTC) X-FDA: 76865509896.11.bells00_8435237ca3934 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id B7D46180F8B80 for ; Thu, 28 May 2020 08:51:48 +0000 (UTC) X-HE-Tag: bells00_8435237ca3934 X-Filterd-Recvd-Size: 4570 Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 May 2020 08:51:48 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id z6so32350557ljm.13 for ; Thu, 28 May 2020 01:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ChVmxnsorYXBU1u6m+PwijMJWe2EJswsgCuSrn12zNc=; b=uGcFgkaybUgqCGlEeapyqGRshtgRePxtUYtwcmiimmp4kSmM8Hb3MdL61WY8zzZSq9 xvafOpuF/qrYwDZ/1Kf4lzEWLcVP4u11TyTJ7VRH20zIZtf3+pXMFD+Qzf7lsGUQ7Z5j quOv5WKzTrUCdbTzp1T3a8Bt/V3HJLy4o3hiAOUY1TZZTILF6/d8zDL8zdWgRwrQFgSI x2fq1vrBiIE46Hcn14ucNhPfXsCTWjJeNcQszDCUT3SgTTuSpM2kIM973qKr0t8rWefO wP42bPXB3AgS9GYwtJxXvc2JmJYY4jcei5FlVtCNLpGx+jh5pRHx+RPFgmydpLqLDUQX OG6A== 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=ChVmxnsorYXBU1u6m+PwijMJWe2EJswsgCuSrn12zNc=; b=EX7OtnMLjHM+tWXC0eq+Zue4gPDgrjZ+vyuRV2rDzo6HYZkkwkmw17JlWYlI+EJ9T3 g7SsdqKPie9xOgsLr/DseopMBw0bGMLXxTJBtbyfiZImP5ub0TiW7cA/uoWMbU8vBA94 rbZjS3FW0m4aoUtrfew8xNylNM7iLM8oW+KIHQF1J+tsiyu4Fm55X0AhiY7fwnj49nur pmlq7nxe+ivzcKbvRse/L//6PlrNwCuc5843x3+Vc++E9grm4ZHh0a6iHqyjW168gZu8 pswm83Hiwua9Z+aCpl2ibi2gGhHhtylaSz7prJrOebdGwZDmxclDSIdj7F3WKc0/znPG rR3g== X-Gm-Message-State: AOAM533PV5AaA2XYFEyMW7NWehpqF/OpkYw7JQtmAdhH9oylPfGOCCO2 FNDh7IGtwXqwd+uzYeFZyXvFCjWe6WVAHq6rwfMY1g== X-Google-Smtp-Source: ABdhPJxRvvlOMlDxeKdcj9DEz+j4kWuU93/Boidwo8oiPnLc0ELH/SOG7sdaZyPywx5vEc266LAtRigvqgFL+GuhwKU= X-Received: by 2002:a2e:574e:: with SMTP id r14mr999367ljd.411.1590655906848; Thu, 28 May 2020 01:51:46 -0700 (PDT) MIME-Version: 1.0 References: <20200526160140.GC850116@cmpxchg.org> In-Reply-To: From: Naresh Kamboju Date: Thu, 28 May 2020 14:21:35 +0530 Message-ID: Subject: Re: [PATCH] mm,thp: stop leaking unreleased file pages To: Hugh Dickins Cc: Johannes Weiner , Andrew Morton , Song Liu , "Kirill A. Shutemov" , open list , linux-mm Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: B7D46180F8B80 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000023, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 28 May 2020 at 02:58, Hugh Dickins wrote: > > On Tue, 26 May 2020, Johannes Weiner wrote: > > On Sat, May 23, 2020 at 06:50:15PM -0700, Hugh Dickins wrote: > > > When collapse_file() calls try_to_release_page(), it has already > > > isolated the page: so if releasing buffers happens to fail (as it > > > sometimes does), remember to putback_lru_page(): otherwise that page is > > > left unreclaimable and unfreeable, and the file extent uncollapsible. > > > > Oof, I could imagine that was painful to debug (unless you already > > suspected file THP due to a targeted test or similar). Kudos. > > Thanks, but I have to refuse both your admiration and sympathy: > mercifully, it was just something I noticed by source inspection > when working there. > > I did then put in a debug count to see if it ever got hit in practice, > and checked after big multi-testing runs: it was sometimes hit, but > certainly not often, and I don't know what it was racing with when > it happened - would depend on filesystem anyway (ext4 in our case). > > Saying "source inspection" reminds me: there is another funny in there, > but I don't think it matters very much in practice, and might need > rather a lot of testing to justify any particular patch: where > page_cache_sync_readahead() asks for PAGE_SIZE pages! > > "end - index" seems a more reasonable number to me: but then we > might find that reading ahead into the next huge extent had actually > been a useful optimization (and those readahead functions impose > their own caps, so PAGE_SIZE shouldn't work out too outrageously). My two cents, Do you have a test case / test steps to validate this patch ? - Naresh