From patchwork Wed Sep 6 12:42:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13375632 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 C2AF5EB8FB8 for ; Wed, 6 Sep 2023 12:32:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 252D8440161; Wed, 6 Sep 2023 08:32:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 20285440151; Wed, 6 Sep 2023 08:32:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F381440161; Wed, 6 Sep 2023 08:32:18 -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 003CA440151 for ; Wed, 6 Sep 2023 08:32:17 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id CA1561CA7BD for ; Wed, 6 Sep 2023 12:32:17 +0000 (UTC) X-FDA: 81206110314.30.81EF462 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf30.hostedemail.com (Postfix) with ESMTP id 8566E80017 for ; Wed, 6 Sep 2023 12:32:15 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf30.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694003536; 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: references; bh=9Vvgv1vIG7kkGfRmw8EhBEN2k5bfFytmCIvvz5mImE0=; b=yEy15e4sgMNfFRILUN7ZQ63WIyEAmPzjVKA30TguJ8tGnYXQDFj9zHoIdezyR0s7/ZFqwR e0b1oW8SV98vAyWrJtFvkLWZgaSkdUkeam0RPHsKAqV4/LvS2PvvXAiKXWiazQshe5HplB wF07ZmM35BY+SDv4xGGRjp2uSV7lisQ= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf30.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694003536; a=rsa-sha256; cv=none; b=XF5yIpMu4kcNUElCM4y8Mu55kzBhpHi/ioqipWHirD2MtfbxRyqldNwaJQ0EYsj4dy89ec VYxzHNupEz2k1l4gRden+J9NTfSfh6vLb4y+9G4LwydZyIQDgs0WtuRr3ZkhFmxwPAa+gc 6GRiEvrjI6BSxbW2AC/cqoMoGDnC5ZU= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RghVH6GYxzhZHX; Wed, 6 Sep 2023 20:28:07 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 6 Sep 2023 20:32:06 +0800 From: Kefeng Wang To: Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , Lorenzo Stoakes , , CC: Kefeng Wang Subject: [PATCH -rfc 0/3] mm: kasan: fix softlock when populate or depopulate pte Date: Wed, 6 Sep 2023 20:42:31 +0800 Message-ID: <20230906124234.134200-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 8566E80017 X-Stat-Signature: 3oow3dfd65j6a5sz876er3ngiubgyugz X-HE-Tag: 1694003535-826385 X-HE-Meta: U2FsdGVkX1/+HhcpsPmtCBYKoJwlGZR/tvn1+Ub7Fdeo0PJQYDBstex1rPoN32yDILNDTMo6HaFgrig9X3na8cThckCnDGoXVsD65QxCaD+3NbUdkxWsBPqNnPHGssasoIMYK1CGBpZIlZU3LWmQb1EyQ0ysGg/7GvcKka9aLi8/mmcXxNY4OGkIlvkxBNLzSZdrgF/qJ8ioiBd4MXT8RiCeqzovufaw5QxEIGDyH0MLyrStk2qlct0W61gjA+y7jMSe8c/R4Me9j7in/y5tgUkRXEGbTjzbkkcCEB1zvJ0cPwYYbJPBdTJgLsp3RXWKqFZKMCjan8U3pW2kDyhaV4RhCnhy0CzJbj/rrFfpJQGnjr2qGzl8N1RSUNlOdPHFLtnrDdw+fvBI6PdqyEd/ANGEZ663eCpjxtyJTOWlQa454MJkbcCHUdP8v447ELb79df7phBnentaMDMmNEwH3TYdxrvr+g3Hp1DzBeM/xlhJWcd0mA7M27Cc3UypdFg2BLH3lKHNDgzjA8tuCNIJoSB2KWwYMG4A1VKa2Aj2juaodIeKmrd7CSUQvm4i7Rzu4+tI9ksPy+hEMSo0JRpKrxfCi7pu/k0SA3x9LW6zZe16nDbUSRKr1yH+0PibW9JCslsfVLpl8+No98DgVz0iQWXlFw5QHJSrXimq9gqngjhIutGpYD56bDNsn5MejniKtt5ewL+B+fpRqhyrRwnd1oAFCKOJyjqInrjYDZ6Pn/rrDu/ptd2Ud3zcYSR0L8vTfdLJQf0DL/Crv2q4kvDzof0QB6FKG+nfumi2yfw5NrBVW3CE0HAiBFBD7HedTCFY23a5PqTlH12tA701h/1qFTlQRAd9g+wDtnEcPTlhUU7IJmSRc4+bylBIQtP06CUFqb+OddTAOa8v12J3p+OP1pT/FTqxTDEb54iu+eywp2mvcTls41IEo+l2FANjSnGipqaKrchkQVOTkW6qI4L l5bidWLX DIZzrjdnSh5taiINUXg3rO3HSvIctq4ElBr5bQXqgsfhVXE5vbBpAL9cCBzHDOB3EzyuZNIZLf3BHfUtxgECIs7cxBxWzlktxFiNeV+9XXRUbPakqkjWQ/tWLFiqW9oW+vHQW4Y3+I2wp6rTtOEhW2Ih14xA/4XQkun5sLkvyPbJ4Etv5Nq9HkCZ6roXebLUz4bsa 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: This is a RFC, even patch3 is a hack to fix the softlock issue when populate or depopulate pte with large region, looking forward to your reply and advise, thanks. Kefeng Wang (3): mm: kasan: shadow: add cond_resched() in kasan_populate_vmalloc_pte() mm: kasan: shadow: move free_page() out of page table lock mm: kasan: shadow: HACK add cond_resched_lock() in kasan_depopulate_vmalloc_pte() include/linux/kasan.h | 9 ++++++--- mm/kasan/shadow.c | 20 +++++++++++++------- mm/vmalloc.c | 7 ++++--- 3 files changed, 23 insertions(+), 13 deletions(-)