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 34202D6E2CE for ; Wed, 20 Nov 2024 08:17:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BCB706B0085; Wed, 20 Nov 2024 03:17:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B54536B0088; Wed, 20 Nov 2024 03:17:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F4DC6B0089; Wed, 20 Nov 2024 03:17:04 -0500 (EST) 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 7F0486B0085 for ; Wed, 20 Nov 2024 03:17:04 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 07A801C7123 for ; Wed, 20 Nov 2024 08:17:04 +0000 (UTC) X-FDA: 82805766876.18.1A628EA Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 0C5AAC0002 for ; Wed, 20 Nov 2024 08:16:07 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YcqAYNOG; spf=pass (imf28.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1732090530; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=gLoIyx3MwjYje1cCzOJ5zph/jdarSH9KY05cS8kqUro=; b=0hn2bJoXs2sCyZbi/ZoZtn3C53uxmbrHpMRSdbI1SBxiosX/nCbKKUC079+FSLJHd2QBjK g/qzbzag2F8109Tj/WdRVdGB+JbQX3v+xccuZvYFrx6H//izxo6Gqizv8DwrrVfGHXVrSw SrIIZG1i8W28hXHazejMGoK3LjZZ7pw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732090530; a=rsa-sha256; cv=none; b=qrKtJdihzj6RiVM4okpwpSZHmzCeBULqvlOvSbepwxzxt1nXR4fGN83gSIJdaz32D5tI4O CMbt9+NUcPfZ2w7zjU+ratZaB/Dm3oV+joGNUZpUDrF1hRLO8a+pP4tyChACWkBsNsgEws n7+koOxWSZYbix2nzCu8HVgrejtcL4s= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YcqAYNOG; spf=pass (imf28.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732090621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gLoIyx3MwjYje1cCzOJ5zph/jdarSH9KY05cS8kqUro=; b=YcqAYNOG81H1DcDRMtZMLyD2U75DQ9FwVrBEg9/LaplUh8B0jV3m1rdlejw35CvyMQfB0E erpvfkGAAHe1jjq17BqjHUeHwXGk7eCr4D3rgiIF8I9FGnDwkhWL8/QBIThWbw23ROnoEl Vls/U4VI66YnnmLasF0of9HeDBZgydA= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-628-xwZYZB6JPMep3tIsEwHwCg-1; Wed, 20 Nov 2024 03:16:58 -0500 X-MC-Unique: xwZYZB6JPMep3tIsEwHwCg-1 X-Mimecast-MFC-AGG-ID: xwZYZB6JPMep3tIsEwHwCg Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5768E19560A1; Wed, 20 Nov 2024 08:16:55 +0000 (UTC) Received: from localhost (unknown [10.72.113.10]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 790CA1955F43; Wed, 20 Nov 2024 08:16:53 +0000 (UTC) Date: Wed, 20 Nov 2024 16:16:38 +0800 From: Baoquan He To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-s390@vger.kernel.org, virtualization@lists.linux.dev, kvm@vger.kernel.org, linux-fsdevel@vger.kernel.org, kexec@lists.infradead.org, Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , Eugenio =?iso-8859-1?Q?P=E9rez?= , Vivek Goyal , Dave Young , Thomas Huth , Cornelia Huck , Janosch Frank , Claudio Imbrenda , Eric Farman , Andrew Morton Subject: Re: [PATCH v1 01/11] fs/proc/vmcore: convert vmcore_cb_lock into vmcore_mutex Message-ID: References: <20241025151134.1275575-1-david@redhat.com> <20241025151134.1275575-2-david@redhat.com> <2b5c2b71-d31b-406d-abc5-d9a0a67712f5@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2b5c2b71-d31b-406d-abc5-d9a0a67712f5@redhat.com> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Rspamd-Server: rspam10 X-Stat-Signature: 38msd3iqhrif4qpjwhntroctfj1wti8n X-Rspamd-Queue-Id: 0C5AAC0002 X-Rspam-User: X-HE-Tag: 1732090567-570052 X-HE-Meta: U2FsdGVkX1/hqXHTJRu0gvI/O9CekHMGqwiZArszzin4luNqj7ozdwNiWd0L0GJI4wYvhpCYyoBX5BegzOGEAzlkC0XithZsPv0p8ozDiS9nG3rNdruyXGYr1vbnOcMNp+wpOVjUU+b+xbi6rMaHZ2rfpdcXxSBuHl1xjjqEL3UV67ouRbkgklrWfBKO/lMcu5nO/sVaqAzr8rOB/rEaz60Ns3xGVgc3qylymNKmeJ/bcZb1Cjj+CM2nL0LRAYiyhhannalJ4Hvi5saxB2cA3yqndyoBTcPiztspL/9z+9g5OntKV+UzT10/hFPKXdg5laK6WBEoEytQ+csXaNy3EAKTYuZ6+7JHDy65lOrVQQsscpS2sV8wtWS5xn+2IDIPuWQigDO7d3yMba9PvMGa4J/sxFPqxqBH/Ex1JsH+pdtf00gT+C61d2wE4nHuzBsrD02V/O0MBRU/ePf63YgoYWf8Ogr0zhW6kFFxZHjXGj53NqxAbmc70gPz5NcvSApaKBcI/5eJT96ququlWH8DFs0Qr67k5XL/5c1Mp+uMK4kzju5eg431YsAec/GUip9mgFPkOCRsWxGivWJcKspRpBPLBvgMb9s6x2YVb+pFwuPoVlSSYf/CtijJdDngM3+Or23tQ0zPMLVjgV5ypdr4OTiGsZqAm//EsedEfkm44oyR0W482EL8NSkDnVTi1KDNjlhOv9ig1iLj+sUlpXZ9PxcSAKCNblPQlHWyQf0j14OO8IXCGbX0qWkmpiKNubi8eWu5WkaNmLPdCoSdgdOzZsC4C8kg/4F6zGU0a64lUJzQ/9Y/WQt37v9wsbseI7i0sbvqQo5PXSU45s0nuQUR4mwutxELYS3hspYyB6sqrJTwApfPrRRD5K2RvgcoUtjO5CIxxbVvNyBxjXdZ2mYLwCHy/kT7pn14ex6VYMf73Uyjc7RRmtqp104iX55aZgtkJK3PbOL+ipSZcbjezRE oYijh7vp rWFXF6MvWl3XnMyLFQs4wnypRxuOGso6ugT8YozuOTOlkjDej1uYH1ya3mw2dHPjO7KByCAw7DUeV0i0C3acmUKeTtLwLDUj8aOZVZaCZNbbT2FxvUVR11yswSUH+kErdeB1gOaD5vwszcp9heDUR6BRUOngosvlY3TaNkS+KkC1ZPb4TLkQe7nwfPyVHUaD2rtQ412lQk7gOexynnB/y2jZSPsVUXN+Dy/R4ckxuEE1eCgLb17rwSCjXhe76evF6RTthzIYKJMsg22hI5zdTMOqQu3gqdH1paP6ZWWLaSIUvcB7d94JsOZlOyIePKftUC8+4HTXQkQRleTfD7nC3iQr0PkeDD3V1BTSDdhFOyRAMhyrOkKZsrKsVhGWYhTBHgrRteScMIchb/QmEdTDAE8HYzw== 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: List-Subscribe: List-Unsubscribe: On 11/15/24 at 11:03am, David Hildenbrand wrote: > On 15.11.24 10:30, Baoquan He wrote: > > On 10/25/24 at 05:11pm, David Hildenbrand wrote: > > > We want to protect vmcore modifications from concurrent opening of > > > the vmcore, and also serialize vmcore modiciations. Let's convert the > > > > > > > spinlock into a mutex, because some of the operations we'll be > > > protecting might sleep (e.g., memory allocations) and might take a bit > > > longer. > > > > Could you elaborate this a little further. E.g the concurrent opening of > > vmcore is spot before this patchset or have been seen, and in which place > > the memory allocation is spot. Asking this becasue I'd like to learn and > > make clear if this is a existing issue and need be back ported into our > > old RHEL distros. Thanks in advance. > > It's a preparation for the other patches, that do what is described here: > > a) We can currently modify the vmcore after it was opened. This can happen > if the vmcoredd is added after the vmcore was loaded. Similar things will > happen with the PROC_VMCORE_DEVICE_RAM extension. > > b) To handle it cleanly we need to protect the modifications against > concurrent opening. And the modifcations end up allocating memory and cannot > easily take the spinlock. > > So far a spinlock was sufficient, now a mutex is required. I see, as we talked in patch 2 sub-thread, these information are very valuable to help people get the background information when they read code. Let's put it in patch log. Thanks. > > Maybe we'd want to backport 1,2,3, but not sure if we consider this critical > enough. > > -- > Cheers, > > David / dhildenb >