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 30576EB64D7 for ; Wed, 21 Jun 2023 11:49:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 41B368D0002; Wed, 21 Jun 2023 07:49:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3CBC98D0001; Wed, 21 Jun 2023 07:49:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B9B78D0002; Wed, 21 Jun 2023 07:49:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 122748D0001 for ; Wed, 21 Jun 2023 07:49:11 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id BC862160993 for ; Wed, 21 Jun 2023 11:49:10 +0000 (UTC) X-FDA: 80926584060.16.74A3163 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf15.hostedemail.com (Postfix) with ESMTP id C3AE7A0022 for ; Wed, 21 Jun 2023 11:49:08 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=JYyqC+rw; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf15.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687348149; 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=/4JQgiPd4ZRBN00ot58q7UpNp/EpBBHux7+J/XZ6tTQ=; b=7Ret3rQkpbj+6Dh8xaFNaWUwQnWxVU96aIGoHyWRBwJ6GpNkbkKXKbHy07JMJhwXtKLpHc HglWuCC1FlR+f2koT994XMzjUIDG3V3Px8GeDUNFg8jztkZdeFcDT5UrZ1s1wF2ig4c4D4 vSwcAOqynGigyCpojiwzG2kVtlpMhHk= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=JYyqC+rw; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf15.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687348149; a=rsa-sha256; cv=none; b=cruysMX85kTmG6AOj/hUUqon1wFQC4BbJ9AQ5q9tnHdmx06hiQm46IZQTBDu8OYIq/d1SG DVkt9OhJpQ2eoQXTRRvqT362pwLBeYh4734eENXu9T0ykdmHlhWLf23yBWPshPf8LZPu6U tB8qNImfqqa5CnkXwVM1iDrvKPpj7xU= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 713C921C15; Wed, 21 Jun 2023 11:49:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1687348147; h=from:from:reply-to: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; bh=/4JQgiPd4ZRBN00ot58q7UpNp/EpBBHux7+J/XZ6tTQ=; b=JYyqC+rwea9U/YhQnluwXDHRi5ZaI74FYnX6j8UfZV5LbSsGZkzEa9dr2vNPYcZnHdCotA r1n0lVtTdGKezK7Poy2ZGvFHhToHV5cBECGneRNksjpBmAuJKnY044qJpW0P1LYN5/IG0e n+ewdp9D1newfIqMWU0AUUwZ3ZcxTk0= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 55127133E6; Wed, 21 Jun 2023 11:49:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WM6YErPjkmTFNgAAMHmgww (envelope-from ); Wed, 21 Jun 2023 11:49:07 +0000 Date: Wed, 21 Jun 2023 13:49:06 +0200 From: Michal Hocko To: Sebastian Andrzej Siewior Cc: linux-mm@kvack.org, "Luis Claudio R. Goncalves" , Andrew Morton , Mel Gorman , Tetsuo Handa , Thomas Gleixner Subject: Re: [PATCH] mm/page_alloc: Use write_seqlock_irqsave() instead write_seqlock() + local_irq_save(). Message-ID: References: <20230621104034.HT6QnNkQ@linutronix.de> <20230621111636.92RxISzY@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230621111636.92RxISzY@linutronix.de> X-Rspam-User: X-Stat-Signature: pqcdrfqcwsomrq3xtcwehytnmhud7fbm X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C3AE7A0022 X-HE-Tag: 1687348148-638630 X-HE-Meta: U2FsdGVkX1+qdbAt4zn/xIEp0gC4qXQLHCgrqG1GA13SloP66x2WiASZxW+pntGmzeQin5PTjSCVP6oJtQRifk1sxQEG2X2Osl98avht+1P8jx7CemUyHdbKUsy8ZgggF46WMyEDVyfJXtE1noNX/NLYahEPKJ5VU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4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed 21-06-23 13:16:36, Sebastian Andrzej Siewior wrote: > On 2023-06-21 12:59:44 [+0200], Michal Hocko wrote: > > On Wed 21-06-23 12:40:34, Sebastian Andrzej Siewior wrote: > > > __build_all_zonelists() acquires zonelist_update_seq by first disabling > > > interrupts via local_irq_save() and then acquiring the seqlock with > > > write_seqlock(). This is troublesome and leads to problems on > > > PREEMPT_RT because the inner spinlock_t is now acquired with disabled > > > interrupts. > > > > And the spinlock might sleep with PREEMPT_RT so a deadlock, right? It > > would be better to call that out explicitly > > No, no deadlock. Let me double check this a VM with mem-hotplug later > one but I don't expect an IRQ path. If so there should be more broken > pieces… > > On PREEMPT_RT what you can happen is that the writer is preempted by a > high-priority reader which then deadlocks because the reader spins while > waiting and the writer is blocked. For this issue we have lock + unlock > in the seq reader to PI boost the seq writer so it can make progress. Please state the the problem explicitly in the changelog. You are marking this patch as a fix so the underlying issue should be stated. Thanks! -- Michal Hocko SUSE Labs