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 X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 514ACC19425 for ; Wed, 9 Dec 2020 23:44:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 217E72343F for ; Wed, 9 Dec 2020 23:44:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731087AbgLIXny (ORCPT ); Wed, 9 Dec 2020 18:43:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:32788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388621AbgLIXno (ORCPT ); Wed, 9 Dec 2020 18:43:44 -0500 Date: Wed, 09 Dec 2020 15:43:02 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1607557383; bh=570lAJpvcycKCGeRkLCf9mvoCYRNpYz9Zni/RqAlTes=; h=From:To:Subject:From; b=aE0fZmPbbeZ0Qd/aJ40bTbJ+Yc7f8cQbKT7PwIeWtLFvr+jwmN1xHvDPWmATUxKFN zXHy0W8KGhv+72PR5POo1U7FGlQ9286Jy92GY0NtfY5QtQrIkXGHPQJbplCtyucV+f mJUmF0IyO6mMWJ+zOen5IA+ZA0HNk3qmT4NSG9FA= From: akpm@linux-foundation.org To: mm-commits@vger.kernel.org, bigeasy@linutronix.de, vitaly.wool@konsulko.com Subject: + z3fold-remove-preempt-disabled-sections-for-rt.patch added to -mm tree Message-ID: <20201209234302.subJO%akpm@linux-foundation.org> User-Agent: s-nail v14.9.10 Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: z3fold: remove preempt disabled sections for RT has been added to the -mm tree. Its filename is z3fold-remove-preempt-disabled-sections-for-rt.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/z3fold-remove-preempt-disabled-sections-for-rt.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/z3fold-remove-preempt-disabled-sections-for-rt.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Vitaly Wool Subject: z3fold: remove preempt disabled sections for RT Replace get_cpu_ptr() with migrate_disable()+this_cpu_ptr() so RT can take spinlocks that become sleeping locks. Signed-off-by Mike Galbraith Link: https://lkml.kernel.org/r/20201209145151.18994-3-vitaly.wool@konsulko.com Signed-off-by: Vitaly Wool Cc: Sebastian Andrzej Siewior Signed-off-by: Andrew Morton --- mm/z3fold.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) --- a/mm/z3fold.c~z3fold-remove-preempt-disabled-sections-for-rt +++ a/mm/z3fold.c @@ -623,14 +623,16 @@ static inline void add_to_unbuddied(stru { if (zhdr->first_chunks == 0 || zhdr->last_chunks == 0 || zhdr->middle_chunks == 0) { - struct list_head *unbuddied = get_cpu_ptr(pool->unbuddied); - + struct list_head *unbuddied; int freechunks = num_free_chunks(zhdr); + + migrate_disable(); + unbuddied = this_cpu_ptr(pool->unbuddied); spin_lock(&pool->lock); list_add(&zhdr->buddy, &unbuddied[freechunks]); spin_unlock(&pool->lock); zhdr->cpu = smp_processor_id(); - put_cpu_ptr(pool->unbuddied); + migrate_enable(); } } @@ -880,8 +882,9 @@ static inline struct z3fold_header *__z3 int chunks = size_to_chunks(size), i; lookup: + migrate_disable(); /* First, try to find an unbuddied z3fold page. */ - unbuddied = get_cpu_ptr(pool->unbuddied); + unbuddied = this_cpu_ptr(pool->unbuddied); for_each_unbuddied_list(i, chunks) { struct list_head *l = &unbuddied[i]; @@ -899,7 +902,7 @@ lookup: !z3fold_page_trylock(zhdr)) { spin_unlock(&pool->lock); zhdr = NULL; - put_cpu_ptr(pool->unbuddied); + migrate_enable(); if (can_sleep) cond_resched(); goto lookup; @@ -913,7 +916,7 @@ lookup: test_bit(PAGE_CLAIMED, &page->private)) { z3fold_page_unlock(zhdr); zhdr = NULL; - put_cpu_ptr(pool->unbuddied); + migrate_enable(); if (can_sleep) cond_resched(); goto lookup; @@ -928,7 +931,7 @@ lookup: kref_get(&zhdr->refcount); break; } - put_cpu_ptr(pool->unbuddied); + migrate_enable(); if (!zhdr) { int cpu; _ Patches currently in -mm which might be from vitaly.wool@konsulko.com are z3fold-simplify-freeing-slots.patch z3fold-stricter-locking-and-more-careful-reclaim.patch z3fold-remove-preempt-disabled-sections-for-rt.patch