Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27889043rwd; Tue, 4 Jul 2023 09:14:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlH7qd0l5WxNlNYVJPZ15DxsY7quZA+/XcG8hdrtARizzffw6ffOxAyyoOlKfwptJVmwggzb X-Received: by 2002:a05:6a20:428b:b0:12d:7d21:eadf with SMTP id o11-20020a056a20428b00b0012d7d21eadfmr13853084pzj.52.1688487269078; Tue, 04 Jul 2023 09:14:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688487269; cv=none; d=google.com; s=arc-20160816; b=pqFMnPdCwBojpcMO38A2TAG+K4bZ4VJpd03S7IrVeGWu5XogNmcADQWWHCWTYmIx14 1naO0TvlUUvl9WTcz1koJ/h+E6DPbNyylqrL+rSoqrYwtK6fS7rKJPKpFZDZt8Rakrg/ Y+4HTbRkHST5oBB1ex49yM1uZ/PWMtFnZU8UKo5dXd2qak61UNPJauSDeE1y6oOe55pf J2KSNn80RVwdLjgZtY3CCq+UMsgyhh1lDHnlpaZVHJMEJYXTr48p6Ala23pLYo8pSMGL LVMz+3QC2/rDRLyUBok+TceJvwKT6lSJCI1Xr2zBnY4aH4xib7WwaOqH4KS5CUoauI6y hCFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=ThWaRfiQI9Y2zPB0jOGll+3lvvzwKEYuVB5/fEadW24=; fh=qMoCLri8UHI4jaYnoiaY1HY7bcZGMkCuwQpep93dbpI=; b=yvIECVfCtVvATJZvGH7btqV23tae2Vy8vb2Z13xGloAdGmY2+63X7L8y/gjyadfGbB 6Vfi8t8SqCmA7Hdio1YSudJnCsr7QfhZ7zqLoLmfaGT8BiWWI7yL95eA7kvHVRFdThka bBUol3e8JN9opaQCRACZrU23uLlS3GXuBTSW5LVfonOYgBl/AArA5hmfcbqph/ggeuk6 fwhjy8CYZt8rkfCA+1Yga+l3Wb6fDD7uupdpRHIU4efaRQM56/7YIjb1cBskG1VnNWwU 9lGVUhZZC9mWqGTpjOACXQca/t8hUezWooFSN/y+FKmd1M1v3Xx/xOn5bKlSpX/E/wO/ uB/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=1G5ZKRpQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a4-20020a170902ecc400b001b8a56b989fsi2132857plh.303.2023.07.04.09.14.16; Tue, 04 Jul 2023 09:14:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=1G5ZKRpQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231453AbjGDQDq (ORCPT + 99 others); Tue, 4 Jul 2023 12:03:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231382AbjGDQDo (ORCPT ); Tue, 4 Jul 2023 12:03:44 -0400 Received: from mail-yw1-x112a.google.com (mail-yw1-x112a.google.com [IPv6:2607:f8b0:4864:20::112a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 551D210C8 for ; Tue, 4 Jul 2023 09:03:43 -0700 (PDT) Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-57a1f51d7a7so10806747b3.1 for ; Tue, 04 Jul 2023 09:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1688486622; x=1691078622; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=ThWaRfiQI9Y2zPB0jOGll+3lvvzwKEYuVB5/fEadW24=; b=1G5ZKRpQvMi6W+jmE8ub5dJeJlxbYBL30Dld2sGE0jGIh4pBJkparpgbY6X3koq/jZ 9g+w0TuaYGHZl27XCXZmG+7CPzvq555V/M1u4Q1o6K8x8Ny1PLqYZEoRKCUHyb+Y70dI uBRHmI/rt4y3gkCQlfmPG1mrv6Vp0NRaNPnW3xuq6LBs3vpTAK9mFbzVtQjSJdhDF3gn OJOlc2lgtywf5qtUGf5eClnJ/DlUSgDiVgxe4+xMH66lLR9gKhagSbS7FM4N2TW1Ak9a q7fzTwEYYTKo4YcVc/r5tuNaJO9KBQwhVG9584Mvf2RQ2kUyvk+4ApeeGd9aS7kq6QuH tlGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688486622; x=1691078622; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ThWaRfiQI9Y2zPB0jOGll+3lvvzwKEYuVB5/fEadW24=; b=ZACL4t1Ufht2XtwV9IMJoSEYzlKShPLn6Uc253UDM3JlbblScL+0ysXriYQbFRdhVk 2UKpEy6CqJCG9Y9NvqpyCZ9t20AJVpd0hxNShtQaHoAva0KKfq9843OObuG1GeoL/VC7 De+q7LDnNQb9F9ci8c6qDKqSIu7i6dNRJAhvEWu0hTgztQ3imooNHKtYWRiXFcj61Jus BnZ4uoBKHb9RuUYlACIMtiFpunTSxfk+henJ26jno73oAty8MhmlhUuB7qHkUj2cqmWW +UqeShNu1cKwUPoS4faPvpuPmBNu0yKI7+71RqZ8HllXL5Tt7VHjjF73sm30H5o3QoIr RaYA== X-Gm-Message-State: ABy/qLZpmFRH+esZ2xD/DyU2bLcDzV9arHRBqAhnPccN6KmpjLcq5fbt 4p2AVDVkbAajvTsIq7FIc7Cq0A== X-Received: by 2002:a25:2307:0:b0:c16:8d80:227d with SMTP id j7-20020a252307000000b00c168d80227dmr13176783ybj.65.1688486622226; Tue, 04 Jul 2023 09:03:42 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id v11-20020a25848b000000b00bf3438d6301sm4519026ybk.0.2023.07.04.09.03.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 09:03:41 -0700 (PDT) Date: Tue, 4 Jul 2023 09:03:29 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Alexander Gordeev cc: Hugh Dickins , Gerald Schaefer , Jason Gunthorpe , Andrew Morton , Vasily Gorbik , Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Yang Shi , Mel Gorman , Peter Xu , Peter Zijlstra , Will Deacon , Yu Zhao , Alistair Popple , Ralph Campbell , Ira Weiny , Steven Price , SeongJae Park , Lorenzo Stoakes , Huang Ying , Naoya Horiguchi , Christophe Leroy , Zack Rusin , Axel Rasmussen , Anshuman Khandual , Pasha Tatashin , Miaohe Lin , Minchan Kim , Christoph Hellwig , Song Liu , Thomas Hellstrom , Russell King , "David S. Miller" , Michael Ellerman , "Aneesh Kumar K.V" , Heiko Carstens , Christian Borntraeger , Claudio Imbrenda , Jann Horn , Vishal Moola , Vlastimil Babka , linux-arm-kernel@lists.infradead.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 07/12] s390: add pte_free_defer() for pgtables sharing page In-Reply-To: Message-ID: References: <54cb04f-3762-987f-8294-91dafd8ebfb0@google.com> <20230628211624.531cdc58@thinkpad-T15> <20230629175645.7654d0a8@thinkpad-T15> <7bef5695-fa4a-7215-7e9d-d4a83161c7ab@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 4 Jul 2023, Alexander Gordeev wrote: > On Sat, Jul 01, 2023 at 09:32:38PM -0700, Hugh Dickins wrote: > > On Thu, 29 Jun 2023, Hugh Dickins wrote: > > Hi Hugh, > > ... > > No, not quite the same rules as before: I came to realize that using > > list_add_tail() for the HH pages would be liable to put a page on the > > list which forever blocked reuse of PP list_add_tail() pages after it > > (could be solved by a list_move() somewhere, but we have agreed to > > prefer simplicity). > > Just to make things more clear for me: do I understand correctly that this > was an attempt to add HH fragments to pgtable_list from pte_free_defer()? Yes, from page_table_free() called from pte_free_defer(): I had claimed they could be put on the list (or not) without needing to consider their HH-ness, apart from wanting to list_add_tail() rather than list_add() them. But then realized that this category of list_add_tail() pages would block access to the others. But I think I was mistaken then to say "could be solved by a list_move() somewhere"; because "somewhere" would have had to be __tlb_remove_table() when it removes PP-bits, which would bring us back to the issues of getting a spinlock from an mm which might already be freed. Hugh