Received: by 2002:a05:7208:3003:b0:81:def:69cd with SMTP id f3csp183712rba; Tue, 26 Mar 2024 12:48:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXw7GzhCRE76rKXvOQavFeV68ZdYNO238i8bAEpHi4ohiuWWSNshBt4lcQx9U53yyAZeU1L0sYDvq5K8MhR7yRPISFfoRLZdi5bbB9SYQ== X-Google-Smtp-Source: AGHT+IH+YmQz4L8HzHr03vTI29XXm68op34AFGHbaNnzsML1LgOwxt5IWk6RxHo2I5i6NB0NMo4X X-Received: by 2002:a05:6808:1412:b0:3c3:a294:5bc9 with SMTP id w18-20020a056808141200b003c3a2945bc9mr2687024oiv.9.1711482503551; Tue, 26 Mar 2024 12:48:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711482503; cv=pass; d=google.com; s=arc-20160816; b=IDNth7fI3FXiFxKGQLlKqx3lhH5Q4Dr55IdNp+doLJrLgcSdo5/ECuCr1vLrNwsYMJ AhTmFu9j9ggDUNuG/Siy37UoqNagpX8haH1kuFtkPuoTVKutymrcJoBi1bAa/eCV3lqq qRRneQfh/AqoQSANMuh46vpPUM++YALdCzHK0REnlIcvhETnvBx2eJE4VLi6ZvtMLg42 3stkx3xtp2KydbIHzj76dPLyRyW/7tsOlNsjitkhMET67iPHlw1HbLhtP2HEpcWOVRQn RLkuYH2u1C81XaEU77oRO3LHi5P99dMGj/y9GSOdze+v18+b5SoPqGmryfBsGt69LoZd W8GQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=MxBAPr9eXOadeecJbaBW+PIKQfHxWzuOy7OIoDoAlhI=; fh=UuK3m83NhfupVB5+xRJHk6gJzb9ci3N1sEAL9unN2Qo=; b=RVYFPxxuUFbK40ObNjJI1ExPE48SQO5XJaZdSccRVrQzn8e/f3S4Z2v2MO2JFytlt8 XA4tIUhKoCI8pLtoxQQYk5gjHYIoNf05rNXkHC6i4qotc5XUgbU41dxuGHxjpeE/MhI+ VeXXMgZulkBoJZo0FkUv1os5W7jxo+mE4ENtKfvSShSnfwhJpEZmVq9x396VoOnE1DYV adzZFFvr3fBvN6GfN20oPgqpXcAtdgRo0ghfNPz37shPDVrfG1tXc1sGxY5qGqIye4yl KbtmN8JpuHdjliC1tmtfsHk5b6dDxUB4vDBq9ss2tLEr53tOuVc6AQckPhr29Cr95uNv HyCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Tr9ln9mE; 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-119832-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119832-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d3-20020a05622a100300b00431620a32e1si3628515qte.243.2024.03.26.12.48.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 12:48:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119832-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Tr9ln9mE; 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-119832-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119832-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 381501C379B2 for ; Tue, 26 Mar 2024 19:48:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5BA013D265; Tue, 26 Mar 2024 19:48:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Tr9ln9mE" Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 C958B380; Tue, 26 Mar 2024 19:48:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711482494; cv=none; b=M1a2boz7eJMafDyFhW5KGqkC2kuou0tWLDR9X8XCObgujgDWB69vT/HZoEG+MVWv0vnyj2/+oZiYdzG0aPyzJwWuUwiL5WeN86nKXsmyEup7CPpb/Qkfc+1TcqFNp+rM+QYnVMniA22n1lgJDxmJvicaA+lFJbo1tZ9LBHmfBeU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711482494; c=relaxed/simple; bh=9cmXfVQI/nC9ykIDRPwIkUayK3sJamHkua2d6Tcdjzo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UfsE28Uh/pE1DpK3G8HGBJvKbx0k+yTfiOihuL7kWorjyDw3H+ZsbcpZFioXT4/ADfHoJy4oMP/Choloq6/ekTXGaNyF/4o9wfxxhr3U7gDAz1J0xjSgYf8wb+2D9TdiQwSzCVR0rQP1kwsaSwqudQuWNlMNwqvOZhSt3hHbHSE= 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=Tr9ln9mE; arc=none smtp.client-ip=209.85.214.180 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-pl1-f180.google.com with SMTP id d9443c01a7336-1e0fa980d55so7828225ad.3; Tue, 26 Mar 2024 12:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711482492; x=1712087292; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=MxBAPr9eXOadeecJbaBW+PIKQfHxWzuOy7OIoDoAlhI=; b=Tr9ln9mEwIHpI19N0/C0EJpHKXphn2mtuT1W4AriiX3AMp+IC90mvOmZY0EkBc6hni 7xtayoWudk30MUKKbxSebe4a3w35kCJelhjlEDtWrKTdDOdYjHGnSBPTaMEKz54ACylt US9Ba4RepM5uko/vevEd5MCFCJWrBHE0tF2FOQRcr+mz4ftZNhjnDy/XqKeORp+mUQ6Q PngtZ2G5uG6rRIWrmqZo5JgXHIQ7uxp7WydV0al2qtBVVoM/txNvSubMQFNFMXA2OdMS vuK4mKagjZLvNTPGeHC/54EfGPT3sQkb1CC7vS5dmKwdpeB1ox3B0jHtndpOJQF9CQD9 BSVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711482492; x=1712087292; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MxBAPr9eXOadeecJbaBW+PIKQfHxWzuOy7OIoDoAlhI=; b=dPFb6IAKBHEHlFkv933l1+rLflMyTDbckn8ppF9CCRte3maIvSunw7vJJ+faOY0nlG hJQ3u16mcWL3kub4Zo1oAb1DbQY3MTk6dH3MCjOv66RSugdu9YuM45wlA5iI5UN7fcwv xhoUv20bg3k3IO6be9VyWjfUSH0x23Wv3BXfbNjj8aOwiRMhyvfut6DtpzZiX5Meif6H 8J5QVNQC6m5eYqBnISyYIa3hKtK8F72KXzEdLDXTmokRCb4zOH352EK9gFW3cSbhS2eH uphluOVbvHj4gD8rvMzkkRrDgam12hyZj/dy8KigcpF8RjMDAbFrS198oT69/reO1xrY PdKA== X-Forwarded-Encrypted: i=1; AJvYcCUzqbbZPzVoT2I+hKrK/6ljfnOU5pz+A7BojdrrzPOyJTi9/DFhYrNYbT6a88SBhFnus5FYBQnW6fjjkRbJC3EL1UKBb+AspdT76T6JZb8l11CJWEbbBCVixhXjM0NmkGLykwrb+jfI3eDUhIXejZnzAceoW8/icGzySq5Tig== X-Gm-Message-State: AOJu0YzckDkl2GLga01cdSgXWykF2RUM3hvm4q6/2o+jE5xnEcHRQ5pG 8Qfyq32Ssov0EndUAG2AkG4hcOsvpKWbRYKj1+4rDRVwdkevvRzY X-Received: by 2002:a17:902:ea11:b0:1e0:a731:ea4d with SMTP id s17-20020a170902ea1100b001e0a731ea4dmr2248814plg.62.1711482492054; Tue, 26 Mar 2024 12:48:12 -0700 (PDT) Received: from fedora (c-73-170-51-167.hsd1.ca.comcast.net. [73.170.51.167]) by smtp.gmail.com with ESMTPSA id p7-20020a170902e74700b001e0b5d4a2a8sm5279877plf.149.2024.03.26.12.48.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 12:48:11 -0700 (PDT) Date: Tue, 26 Mar 2024 12:48:09 -0700 From: Vishal Moola To: Qi Zheng Cc: akpm@linux-foundation.org, hughd@google.com, david@redhat.com, rppt@kernel.org, willy@infradead.org, muchun.song@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christian Borntraeger , Janosch Frank , Claudio Imbrenda , kvm@vger.kernel.org, linux-s390@vger.kernel.org Subject: Re: [PATCH 3/3] s390: supplement for ptdesc conversion Message-ID: References: <04beaf3255056ffe131a5ea595736066c1e84756.1709541697.git.zhengqi.arch@bytedance.com> 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-Disposition: inline In-Reply-To: <04beaf3255056ffe131a5ea595736066c1e84756.1709541697.git.zhengqi.arch@bytedance.com> On Mon, Mar 04, 2024 at 07:07:20PM +0800, Qi Zheng wrote: > --- a/arch/s390/mm/gmap.c > +++ b/arch/s390/mm/gmap.c > @@ -206,9 +206,11 @@ static void gmap_free(struct gmap *gmap) > > /* Free additional data for a shadow gmap */ > if (gmap_is_shadow(gmap)) { > + struct ptdesc *ptdesc; > + > /* Free all page tables. */ > - list_for_each_entry_safe(page, next, &gmap->pt_list, lru) > - page_table_free_pgste(page); > + list_for_each_entry_safe(ptdesc, next, &gmap->pt_list, pt_list) > + page_table_free_pgste(ptdesc); An important note: ptdesc allocation/freeing is different than the standard alloc_pages()/free_pages() routines architectures are used to. Are we sure we don't have memory leaks here? We always allocate and free ptdescs as compound pages; for page table struct pages, most archictectures do not. s390 has CRST_ALLOC_ORDER pagetables, meaning if we free anything using the ptdesc api, we better be sure it was allocated using the ptdesc api as well. Like you, I don't have a s390 to test on, so hopefully some s390 expert can chime in to let us know if we need a fix for this.