Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp109773lqb; Thu, 23 May 2024 12:13:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbJO+R2U5ACoq4adH1x5SRoYvT5IUcpZP90LB8uKp8ZnJY2ggN54leuUEWd2DyXlzL4wBRX5//qkeKcGTbWcONMF/NSfd5SLgrBH36Yg== X-Google-Smtp-Source: AGHT+IHPwwtEhyDdeYUuLyrOciIr3+QlNbd7y4x49DQUhHWSQwBMxKyT+U7sX0frRxWfgujzdhLV X-Received: by 2002:a05:6a20:3d85:b0:1af:ad46:cd4a with SMTP id adf61e73a8af0-1b212ccf897mr510148637.12.1716491635960; Thu, 23 May 2024 12:13:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716491635; cv=pass; d=google.com; s=arc-20160816; b=dR7vyUQzpFbubtPn9ywT+lzxoSG2ewVqwTvcFiuErPAbJEhsD4K1cd6jSjw4d7csUi TCjabi4y/E2P0Wdl2FIF4pH8rz4icH7oNFeQgKVav4ZXKiLVulgbEmwvyCllcoFNfQ8z 0FadCvvQdwWvxWiSAhP8syXEQ14EYHgRbuU04rJ2Wj5vRoWFyiDn1E1gBamb00UAlgLM 85xKfKUKGdCKrSexnsNe1RexwCrgSPQwhEvIstfubChZ7iba1KH+sxntWmbGsqrkN1WA 0V8tg3kc5/zDJMBYeX3g70mFs4bd4igwSE1HdOtTuUbi+EyDMcc4xA8y3rVxX7qfpyaI rDWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=DaSZZvzNRbRCRLuNfpy0v+O8FqRfuxuYoiMLYKLlK5w=; fh=JsriIitQDS268Lg8arDVSnE/WaQveNnvDp8a/GLSFVo=; b=YkQj4BrHgeiKQXFbblQHJwYcwzsAGhrI//r2Wew69gb3S8wytkkkNmftTuVU9KQNSj 9j86ll+oMOe7vEZit1ntLXivUrMXM9S3OBjC8cvIptv0kAAQOzd9yLmYlQtzFsBYCu8Z 9YrmlHZ2+Wantg5eGqa3/j4V4Jaoo9l2EmFDdpjQiKKqElpU4nmE4F10e3AFuvUeLp7K DrbhrX3/Ba8LhStPZRzvsjG8NkDyKGVeI4jgMDoHeSt3YX8uPWBgJ6MfVrR8uuXDXw8M VJRW02nbX390QBvuF1rJUl1rrFTzvmOsSK4pYdWZiw69rjUqrNhUYPGA5cYXWN8SVjSY zu/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=0PL4Ar5s; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-187911-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187911-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-64b0e5ccf1fsi1417593a12.127.2024.05.23.12.13.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 12:13:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187911-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=0PL4Ar5s; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-187911-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187911-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4F4A0282A8C for ; Thu, 23 May 2024 19:13:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 67DD482D9E; Thu, 23 May 2024 19:13:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="0PL4Ar5s" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A40860BBE; Thu, 23 May 2024 19:13:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716491627; cv=none; b=pUX9NKjImsWhOPKdnsRFQRAuK+IN3rjE4ibdWWUf94HWEjF868NzjHi2AVYJbtbZcsqy6YeIuKrMhx9KJEmvYUbFg8NeAWjope9mG7mSbyJUwcmLTC+pxEtR4VfYZRq9VBEadjOWCD/QP0pzvY2cQIgM22f/tLzPaRK9e+shDq8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716491627; c=relaxed/simple; bh=+JOFaXZ73U5uGnk9S9gTiM6JcwXiBpR5hDiNMxbHwEs=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=kiiWXtmVbEfkDnGZnCBhiRNLnbEIAFcgIiHuNnN818UXM25cS2ac8L8uUtTnT8LQJUWcwH1n8YDIgqyuPpD6avJUB4U4XZQPEggLiFBy08dxu8EtHxchOERqsH0xEzNaFn4qRococ31rqH66q6E+eJ9DCNnetOhwnjjBikkKdhU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=0PL4Ar5s; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88791C2BD10; Thu, 23 May 2024 19:13:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1716491625; bh=+JOFaXZ73U5uGnk9S9gTiM6JcwXiBpR5hDiNMxbHwEs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=0PL4Ar5sbdb9hd+8AwsrwqUSMI0PeChmRoviG1HBMJXK22+BmiR2yY5/loVJ7TH86 /kUFqgPLQNauTjDcASYiUW/QhCFYj5Vtngv18YndVjQ85l4RGgnMzIDl4cO9IOgmQo GwEFRy1I4FOOsvUe0iHS0V+Llx4IUJN1X/03mynw= Date: Thu, 23 May 2024 12:13:44 -0700 From: Andrew Morton To: Donet Tom Cc: Shuah Khan , Matthew Wilcox , Tony Battersby , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Ritesh Harjani , Mike Rapoport , Muchun Song , David Hildenbrand , stable@vger.kernel.org Subject: Re: [PATCH] selftest: mm: Test if hugepage does not get leaked during __bio_release_pages() Message-Id: <20240523121344.6a67a109e0af2ba70973b34b@linux-foundation.org> In-Reply-To: <20240523063905.3173-1-donettom@linux.ibm.com> References: <20240523063905.3173-1-donettom@linux.ibm.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 23 May 2024 01:39:05 -0500 Donet Tom wrote: > Commit 1b151e2435fc ("block: Remove special-casing of compound > pages") caused a change in behaviour when releasing the pages > if the buffer does not start at the beginning of the page. This > was because the calculation of the number of pages to release > was incorrect. > This was fixed by commit 38b43539d64b ("block: Fix page refcounts > for unaligned buffers in __bio_release_pages()"). > > We pin the user buffer during direct I/O writes. If this buffer is a > hugepage, bio_release_page() will unpin it and decrement all references > and pin counts at ->bi_end_io. However, if any references to the hugepage > remain post-I/O, the hugepage will not be freed upon unmap, leading > to a memory leak. > > This patch verifies that a hugepage, used as a user buffer for DIO > operations, is correctly freed upon unmapping, regardless of whether > the offsets are aligned or unaligned w.r.t page boundary. > You have stable@vger.kernel.org in the mail headers, so I assume you're proposing this for backporting. When doing this, please include Cc: in the changelog footers and also include a Fixes: target. I'm assuming the suitable Fixes: target for this patch is 38b43539d64b?