From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B444EB64D9 for ; Thu, 29 Jun 2023 15:57:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CF43D8D0002; Thu, 29 Jun 2023 11:57:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA4618D0001; Thu, 29 Jun 2023 11:57:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1DCD8D0002; Thu, 29 Jun 2023 11:57:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id A2BA68D0001 for ; Thu, 29 Jun 2023 11:57:36 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 57FDD120550 for ; Thu, 29 Jun 2023 15:57:36 +0000 (UTC) X-FDA: 80956240512.16.654CB13 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf01.hostedemail.com (Postfix) with ESMTP id ACCEB4001B for ; Thu, 29 Jun 2023 15:57:33 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=fJat8Sya; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf01.hostedemail.com: domain of gerald.schaefer@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=gerald.schaefer@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688054253; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=J7n4i56PjuYyheRXiT1h3zZxQxjoI3aURFtsNFhnzeA=; b=RHANqcALJxlEu51EUgqzP6L/48Bni0Q8nS20jSWF0j6RNHhIa/qxWm8E+VXGVrugBtmpZe Ge9C2aMSfS2Po8UHOLKWk010qUBHQaH1lUewQp8Kpjl7DZM/Q6FOdcs8yUKnDcEWcv+PaM ZM40D/Jahuyk7Utbqx+/XkOhjL4HYOE= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=fJat8Sya; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf01.hostedemail.com: domain of gerald.schaefer@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=gerald.schaefer@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688054253; a=rsa-sha256; cv=none; b=kn1KUMuRCihXS5pzLzy2MLkWwpU4cAstZXs9wO204uC68e4daIdjvRvLcuE/uOeQn9luTq kOwF/NXrqqFgzJciKmyGDJXivO4zXm6zmHx4UC6YKfCThmT9hZ2HMvDBFLNP8hYGqzZCW6 nXdmv620BNOo4IrIR1QrBjUfHTzEgIE= Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35TFkPM3013631; Thu, 29 Jun 2023 15:56:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=J7n4i56PjuYyheRXiT1h3zZxQxjoI3aURFtsNFhnzeA=; b=fJat8SyaeO/jZvMndX/6x2417ZRjc3DZarZ7bW3z0FoTpRYKPh4uN7pNn4UOWvjmarb3 IQY5nUFE7bNlUXBdxYReE0UWVSc7h8MRtk0yunuB34XZ1e1IZ0OMI4kuGS/U9811cf7/ U3nYS/uC5jUqbncbZPgN3IuVbY2a2fX8k2AeBsXt/Qf2VDYXWWMoLcGq2VFRMUuy7HEC KelsobjcuzPUpzItspSnwXtI5BMpby7hEFvy37e1OaFOZEdUaTogamnt2NO8uIdWrGxm i/5uAqXxKof5noy3h3DPc88V6gPsb3oWVvXrivfb1f6cNgZlA6YAnbwXml0QzwKKt0Xq Aw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rhcw209q5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Jun 2023 15:56:59 +0000 Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 35TFkvQd014751; Thu, 29 Jun 2023 15:56:58 GMT Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rhcw209p8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Jun 2023 15:56:58 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 35T4lrrC024964; Thu, 29 Jun 2023 15:56:54 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma04fra.de.ibm.com (PPS) with ESMTPS id 3rdr452k48-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 29 Jun 2023 15:56:54 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35TFup4K56361424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Jun 2023 15:56:51 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E2ACC20040; Thu, 29 Jun 2023 15:56:50 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2131120043; Thu, 29 Jun 2023 15:56:48 +0000 (GMT) Received: from thinkpad-T15 (unknown [9.171.52.248]) by smtpav05.fra02v.mail.ibm.com (Postfix) with SMTP; Thu, 29 Jun 2023 15:56:48 +0000 (GMT) Date: Thu, 29 Jun 2023 17:56:45 +0200 From: Gerald Schaefer To: Jason Gunthorpe Cc: Hugh Dickins , 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 , Alexander Gordeev , 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 Message-ID: <20230629175645.7654d0a8@thinkpad-T15> In-Reply-To: References: <54cb04f-3762-987f-8294-91dafd8ebfb0@google.com> <20230628211624.531cdc58@thinkpad-T15> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 3HDFPvbn1Kqe9hJCMmYTIt5DBeoBHNxy X-Proofpoint-GUID: lDFvs8dRlpQ8RTlIWc53XmzE2FLLW2CQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-29_03,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 spamscore=0 suspectscore=0 adultscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306290140 X-Rspamd-Queue-Id: ACCEB4001B X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: y5dwbpm3mwezttq1io6b385jpfr1nqbz X-HE-Tag: 1688054253-682844 X-HE-Meta: U2FsdGVkX18YtQxR3rQU6/2Bd8ygGa9iHPx3YwKFBtDeHTGjYWZCW5n7r0cIvJftAlLrzzvTQwFbfMKzpO5n6LHn07iwPVEZBFxmWZhX16Qeg1RAdc8s7TWaOdDOIRcTh2CpnbGqndPA7qTiY9K7Y8zUeOtyVOGaD3YtMxADGmisMxTqsv5/zkPVV3KWNIDWOr3AmoSfQBLd1HFjyCsDoI0fwsEDIrj+NJu00O598Q9LICoQJQ3H1RNOM18lumINx9cBOPWFXc4yC7/nWELNSbhup7e2zbWStuIP/7uAeSZ4fyyNIOT8PwFvq+44Iuom85o72DYNgG03SnmMoqUJRTLS41Hg91pvKHvG1TyQnVdoM6WH7lKowsAM+qke2e2i3bI30QrPnjGxm+CNwE3TdIwYlYBdSZkhFSH8MAWFZOd8M1idnc/X5/Rybpsgqv3eD0hwXUp2iyYFMjSkKsYEIrz8p/u4vlHkAg8iJrEmYhAwLBJIJWrmwo21h8HHq0YeKhFeaMV+Elsu9sI5Cx1T651VrOkThzgKHFd80bKTUt094VV24LVF3U1ue2fjDndWpeq2BVjdaAPjR2PS4Gu1usEWyR5+Ojy1vX1HbObiCYvcBl9qXP+/TX1SSCqsRFOh4hIzKvgIqdiR4YpAPmstahpqDRH+Nj4hQjCRcAzAysMhoa6/Z2p8QNkmyDc2XXiPNktKHW5hqOu2dtF35KWJNRSP+CEx0D6+gorSwzchZH4rwEQAPWZWmzGRIZcb/apjFYKPHV5ztvSKFeh6Iqn9y3Ib5ZbZP9DsHXjMTakM2BApUCVhEIwH0Nc3SQ4z/k9pBQVVcGbmHq57HBmVQOAXJOqwpYauSxz4q8bEh+DuY59vU997Dpymb/WE5Kt9o3kxyl/dWnZai7Hm4zbuiJun9OXiyxWuNwUxyvXJlr+GCv//Oc2rBfkz2wj41UEYjPn2KU2Synyt3jfJzp1VVvY KGlrMRSs 9dKc+RtGZzWzA075nl2H2qJjZU1XB6o9aPCIcUB/qrA7fZtzjZBu/zaq/QYaJLeZ0ehvbwvD04aH04tcz3qxzqOQSxgad9fr8cIzOA3ny0wKBUNTvwljZKQOQ7YdXevzoFnpyhf0xmI6f2irpGH8zgPF0e0XlpqxqXEJBMgCtGDmQ07HdUS707FulCf+ppUQRsTwCNjYhtT1kdQrltafGurlqOZfqgffiSdBWWaFxal/YkwVvupnO8eYyYl6ViSRzEIofQv4JV+im6XmEgHV5ezFoslDNldvaGpL2RTVfv+mLL8VYFPaBMJ4YghQNBh7fizXW8hCORdkPkiYs7LlmRihN86F0G4gIgrLW19cOtZlK9KByeFUhJen9NQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 29 Jun 2023 12:22:24 -0300 Jason Gunthorpe wrote: > On Wed, Jun 28, 2023 at 10:08:08PM -0700, Hugh Dickins wrote: > > On Wed, 28 Jun 2023, Gerald Schaefer wrote: > > > > > > As discussed in the other thread, we would rather go with less complexity, > > > possibly switching to an approach w/o the list and fragment re-use in the > > > future. For now, as a first step in that direction, we can try with not > > > adding fragments back only for pte_free_defer(). Here is an adjusted > > > version of your patch, copying most of your pte_free_defer() logic and > > > also description, tested with LTP and all three of your patch series applied: > > > > Thanks, Gerald: I don't mind abandoning my 13/12 SLAB_TYPESAFE_BY_RCU > > patch (posted with fewer Cc's to the s390 list last week), and switching > > to your simpler who-cares-if-we-sometimes-don't-make-maximal-use-of-page > > patch. > > > > But I didn't get deep enough into it today to confirm it - and disappointed > > that you've found it necessary to play with pt_frag_refcount in addition to > > _refcount and HH bits. No real problem with that, but my instinct says it > > should be simpler. Yes, I also found it a bit awkward, but it seemed "good and simple enough", to have something to go forward with, while my instinct was in line with yours. > > Is there any reason it should be any different at all from what PPC is > doing? > > I still think the right thing to do here is make the PPC code common > (with Hugh's proposed RCU modification) and just use it in both > arches.... With the current approach, we would not add back fragments _only_ for the new pte_free_defer() path, while keeping our cleverness for the other paths. Not having a good overview of the negative impact wrt potential memory waste, I would rather take small steps, if possible. If we later switch to never adding back fragments, of course we should try to be in line with PPC implementation.