Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp258579ybm; Thu, 28 May 2020 01:56:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxznSqkFnV26BfCcp78GmvO9C9DGblKZStZtxQch31AT38zwNxgesBe1eRa/JbeN8Wy1Ame X-Received: by 2002:a17:906:5695:: with SMTP id am21mr1917372ejc.223.1590656178908; Thu, 28 May 2020 01:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590656178; cv=none; d=google.com; s=arc-20160816; b=o4PYOpmP//puJ0NWDza20zMsXeHr5TJHyrzrRFWUTtspsg4Lql3l7Vl0HYtTobR2EA Dg7OLw3VCnpybG9px9TR/03kAXrrgdDoJs3rSAbBfUL4qI78dHuNVGvDMg7VzmIzCEti 6UJR5IoKLo4qjdr9VDd4/gViM8t8hB5x1z2Qjpzs0L5xJMkMk8GsBqabR5mB+6UD2YPj r9SqeqxysaE4Smv3BDSy0w9bcmM81lZudZREPo2fEbxkfYMrPIsRfXH/bXQIKsgwvI7k uG7yep0hbD3WShuDQaU3UgIq1rVRRv2wU37/eE++Zh41BruT21nO5/i43jrenftzImR2 tZbQ== 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=ChVmxnsorYXBU1u6m+PwijMJWe2EJswsgCuSrn12zNc=; b=Zhdm7noZHF2RFvZUWt6jXyXbZE/lGUuOCLEu3HR8015m53fpgzAWghmqtVDgGDWzm8 RHagJu9qtDXNM4ArDeUWLIsvnqVZu+AXbpdZkvaCSeZzaR31Utw6f/MdpV9sZ+6Qqfwu wofSMkDrMgYGhvBTpi81sx+HDPnrQomZzOecwcsIws6fJfMFlFSn8hmmsvFxEW7LsEdv 5MyJi4P9LtApnS9ANQi3hzZKkHLbrwi8g8VQ0fjg9Thiw8OVvN2B5nUMa+rMB3HeAzrc m8J1BtG3QR4DXLAeSzeGZTuRtiY7m6mSFwzMw3DwB/K0M7U9SrDMPgfwsEo4gRUbEo6e lWtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uGcFgkay; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bt8si158252edb.257.2020.05.28.01.55.55; Thu, 28 May 2020 01:56:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uGcFgkay; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727986AbgE1Ivt (ORCPT + 99 others); Thu, 28 May 2020 04:51:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727088AbgE1Ivs (ORCPT ); Thu, 28 May 2020 04:51:48 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 715FBC05BD1E for ; Thu, 28 May 2020 01:51:48 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id b6so32423596ljj.1 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=C/r035FX6xRWBz3593NaUIALErhXCVn5WWQ3siL2j4AQ+R9AVJybuwQ9SpXcu70Yvm CYWhiFkKbAvapeKzgvFR9z5GX09LcWasx9xRhjCOMTjVjtqzPEh/OxStGaMvvWW5eYMR sOqm062ZOux29JfVxviTy0j3DnQeIBUG1CwbJbZW5bOq4tMixWjlXIJYpDzU9kdRHMRN 68m+GFVtEqxS3zwWrc2lSEraHqztHo630Eqnh0ANgYTL9YeLNSv8WnTOr5Mxva7HrACC Qmd9uZXkuNmS4a9cLuB7HQZV5o1qEwDcwFT8o0bcl53fmvkVua9UsVEN/4MRG0+sM/yK XsAA== X-Gm-Message-State: AOAM532VsGr905TvlnEaIltpaN8mpym7dIwABoLW3pNBnTQgG0uQGg3V n1E1r7mJ5KIpCj8e32ttM6jGEU1sb3Vv3U52s/JO7rjdJLs= 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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