Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp362926lqb; Thu, 23 May 2024 23:58:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW4njsudSpZMprJcH4HnFEhm0llwuEfif75ZvxTfNN1G7baLgANA8K46yupfpv4bwiBZYi4Fm6+DvkERmEfVmeBH+Hm9WtJcQNFETiMVA== X-Google-Smtp-Source: AGHT+IHcDVxJ0dm1PKr3MndjmZOiypqn3uuH+OSfwvjLwzPVhZ2Xdj7xNaKo9pHdncd54WO9poHP X-Received: by 2002:a17:902:e551:b0:1f3:1597:5e2 with SMTP id d9443c01a7336-1f4487057fbmr19417665ad.19.1716533916326; Thu, 23 May 2024 23:58:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716533916; cv=pass; d=google.com; s=arc-20160816; b=jiS5XvviZyZvjrd08T9enQO7YE0Ut35lviH8F15LnDd6Aj6hi/P68mpQYe1DI6ymP4 yifpvJMjgm3QZ7ZOi1kpEt4w6hvOSygrE/lTzyNv4Q+dZntZwo/Kxmt/UTqt35JO26Lt uy+lLqHmD7f7kk+Gwa33zvUv7N1NEDJcSB5QBY4d9WdM5M7UfzDvvgf2PHmaZzyhiAHh XRmrggc5kruTKOZRhrnF8QmPFSBx2uEzmWrmJ4p30SLaw1ZWGNYHxyIpxIOhWvhmjSth 0SKOaWGTSnEMtQf1Yqy1bEsJHS/JgEeqScY1DI4RnlU5v6UlIjXZAuil0WFSJ0LqpjZy SLMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:date:in-reply-to:subject:cc:to:from:dkim-signature; bh=WUxSDJgPVHpIgkdW/SJCU4zEFv1caSZKZZ1ujvSgGJk=; fh=M/cmuOtEfPFXwzzggtOHwnwfbqVd+uxaQf3wlrez2QE=; b=K+ISKzGdba0uv7OOITrt0uvdMya5ZwjvX/vJyIypFeOU6jq9xOR04CC+/hXtpC1smE JXsjNGfSfrNa4136j+LJVItz22wCTYeET1IntLLDHvZaw194eG2+94ia7D1PmsqS0swL wstgN4QHrHGSjxc87Su7WmCKyU5R2sPA4cyus9LH4drNpXqsSWUI/UkkKiVUvDUY67Vm wPWh9gwkJzh7fK53IF/msNfYrQ+/WFD3o0sK7+nMjLJ2PWqXFqlhuY4cOT9m8eRpD26A J5iGX1ADEOrUar0kUKLt4B3QGW4bALOFJ0hv+gBeDxkBo1nlHVbem5L1IGj2MtE/iB/x TgfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=X2AEojRY; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-188374-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188374-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f44c971463si7841115ad.321.2024.05.23.23.58.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 23:58:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188374-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=X2AEojRY; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-188374-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188374-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 893DBB20B9B for ; Fri, 24 May 2024 06:58:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B1AA128363; Fri, 24 May 2024 06:58:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X2AEojRY" Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 532AE3D575; Fri, 24 May 2024 06:58:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716533906; cv=none; b=FjjBN9Oa16pvNOQfgphpjcY86CM9F2jZG8yQSX3H6wNA6uo5QRE0mpkDVeCugDYVumtPmjY6rhGRhMmjx8ulnAoHNOsZXo0MsSE6n17m1EGeknJzKlDPygfBUWddVcA4YNSvBw7YE+fUWrDUZrar+gRi2361fCA/f8HkliicVJo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716533906; c=relaxed/simple; bh=VHScqeC2fmLF26N/w+C050h4YTn2N+1Eu/SkdWLkdsk=; h=From:To:Cc:Subject:In-Reply-To:Date:Message-ID:References; b=lWJ6kPinW/mW5r9TKH8XK3YNtX37rYwly69Y5U1REuuowOYITf+UMiTIe2i9R6XD2teBKHZhtC/VOiNZFzeLA5KnSayIIvhj4Osjiekps58Y+TUPy+Dq/sY4gIjbo6xgsBLPWCwhL+lnQAXgBbIvHvPNQFrPW3lKmUxr503wS98= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=X2AEojRY; arc=none smtp.client-ip=209.85.215.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-681907aebebso416175a12.1; Thu, 23 May 2024 23:58:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716533904; x=1717138704; darn=vger.kernel.org; h=references:message-id:date:in-reply-to:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=WUxSDJgPVHpIgkdW/SJCU4zEFv1caSZKZZ1ujvSgGJk=; b=X2AEojRYczbWEOe18ry1bGSu7rfhgqM0+YoYiTSCizR3McMQXGSSUqs8H1Hg4F54xg m1EXvQkJdVZaAp1+aTcn+na/DqKqSwC+pStqWv6z1SGr2fcYU/DEIDoxOw6KFQ3ZEXBa AnJJtbO5dBEATfdJBAxv7d15IuvHZjQDUfjwBG48kpPs0N2EzaRZEUP1Or6IfFn1F7BO KadUyOhy7r1BQijTug9MXnnCPwaiCUinKOtub8G6pgGRVOpP++6I+FK8cJM2PoD/RF6d d4O4m6R6LVgpsHJ+0H/7RgW/xSF/7lxsQW5bjcTXcJB6+QG1hz6N5WNiPDruaVvqC1S7 ij+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716533904; x=1717138704; h=references:message-id:date:in-reply-to:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WUxSDJgPVHpIgkdW/SJCU4zEFv1caSZKZZ1ujvSgGJk=; b=ub1pXiLsTOhIOMkC9/b+dKytkbuK/uMcSGcrpGFxcw2MTj6QCdSYnkun2COHG1fvYr oIW3EWg1KaCoc8ziqjLoFDst6xf9qOXqhBsBV8XBeyThJkAdD4fvbAleILmk66M7M+zZ zrRAYEDf+9pacqcPxqMrcegCPfB13+eBnBz1XwWpZafgAbjJWZEalkpJkmhPKKayURC1 HkNqCE6PSIDIkBPGMdvl906cBRAvGnlqKzFhv4RkACR7OSKhx5GzPVZlKdfWT4y8Qg9W juv59gBBG7szhY2DRBounRXf3cFKCrWW4H6FFQ6u4D0uczErL69F1zepyLLzxsVEyr/t fO9A== X-Forwarded-Encrypted: i=1; AJvYcCWCaelZ5YVcvCZZy3W6X+dYkRA3gPcQ4LoGPkMo5RfWFl+ZjVxc0/XJIDkBwuYSBRhvQOQCEVxZIWYLASG/T0VfKgT8hcZqLnUOYsNBKJl471rFcnXtJDppzwfnvQiWYnHzv0hw11XGb7vAw5Bq X-Gm-Message-State: AOJu0YwwKNNPnxzHB3bTcv48rV+m5/XnVsapy3LhC7eoGu8c7wAP4PLt Nl1ZmfTXmB0mlvTmbpi3pEiKWbsNczjLZ6d2IY4mH6HIMU2IST6t X-Received: by 2002:a05:6a21:3e05:b0:1af:5d8e:c6c with SMTP id adf61e73a8af0-1b212d5df8emr1657909637.18.1716533904568; Thu, 23 May 2024 23:58:24 -0700 (PDT) Received: from dw-tp ([129.41.58.7]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f44c7d1b46sm6763385ad.110.2024.05.23.23.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 23:58:23 -0700 (PDT) From: Ritesh Harjani (IBM) To: David Hildenbrand , Andrew Morton , Donet Tom Cc: Shuah Khan , Matthew Wilcox , Tony Battersby , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Rapoport , Muchun Song Subject: Re: [PATCH] selftest: mm: Test if hugepage does not get leaked during __bio_release_pages() In-Reply-To: Date: Fri, 24 May 2024 12:23:15 +0530 Message-ID: <87msofsntw.fsf@gmail.com> References: <20240523063905.3173-1-donettom@linux.ibm.com> <20240523121344.6a67a109e0af2ba70973b34b@linux-foundation.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: dropping stable email again. David Hildenbrand writes: > On 23.05.24 21:13, Andrew Morton wrote: >> 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. >>> >> > > Two SOF, is there a Co-developed-by: missing? > Sorry about that. Andrew, could you please add the tag (let me know if you would like me to send v2). Will take care of it next time. Co-developed-by: Ritesh Harjani (IBM) -ritesh