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 022F0C433EF for ; Thu, 21 Jul 2022 11:33:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8AB8A8E0005; Thu, 21 Jul 2022 07:33:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 85BBB8E0003; Thu, 21 Jul 2022 07:33:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6FB6F8E0005; Thu, 21 Jul 2022 07:33:35 -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 5FE088E0003 for ; Thu, 21 Jul 2022 07:33:35 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 87B00C05F0 for ; Thu, 21 Jul 2022 07:55:59 +0000 (UTC) X-FDA: 79710348438.01.0B2852A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 2AB0614001B for ; Thu, 21 Jul 2022 07:55:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658390158; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JR52ASBNCBrVHKbWP37DJBPzWGapieKRruf6K/rMN8o=; b=LZiDSbvvz8gc1nEMOAZfhgr2nnx4I5ORWlErc/rjFRb8TzgMUDGrHXvn4AaxjPDBbMvEWT eAUQKTIKCftDJuETBjmPJyEHHGx1MLZ249wZOiXdS3jpmy2fkXQkIeURelA16cR3OekghE +0+3jUu9VAvQBZDxsnQHWT97M6cOe8Q= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-488-lWItz7MlOzKUA6lQov6rlQ-1; Thu, 21 Jul 2022 03:55:57 -0400 X-MC-Unique: lWItz7MlOzKUA6lQov6rlQ-1 Received: by mail-wm1-f69.google.com with SMTP id r127-20020a1c4485000000b003a2fdeea756so2464087wma.2 for ; Thu, 21 Jul 2022 00:55:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=JR52ASBNCBrVHKbWP37DJBPzWGapieKRruf6K/rMN8o=; b=CvtYTmUQZh2Y7bXywueOVhiFhhLT10TbtEI3O3RnFzootxMWSYM3b1VAjXuH0yro7G xCyLujSXMUJnbRGgOfKpJg31FWIHX+YYTk6QnPRwlbc/Dyaw6VEur6DuZGtjibjwwf+r Y/ahPwLGAhiI8Wt7kqFvYbbiRTSTYo5yDwgGOYzEmxyRlzxHZpWD3skb2U31EGm2aTrB 4ufQX63MxRNnOiuAY6mBymrpVm59j6x0tH/w+qXvaq73Z0XTQq/JFLF8Hbq6U9yVN/Ps RYytRUfnJYM7SHENPbhPaspPeX9uCN2Y6y4n3ik2Y4e+DGXWeTSSU92FeWi0Nycru++R e5mA== X-Gm-Message-State: AJIora9IpZQk3L06m8qlfJ1hUOlNvC5WifcEkUSmgi6VkXzSLrZgCE4a WgGAlIYV/FQOqkwuXqysxT6hDR/CJ20BTeCUVzmjWiXK7sjzXm9VZoA+u0mfCkT3B3v0gcphJ3u CZ5CrqRMRZqw= X-Received: by 2002:adf:d1cf:0:b0:21d:a2cd:522d with SMTP id b15-20020adfd1cf000000b0021da2cd522dmr33169532wrd.383.1658390156192; Thu, 21 Jul 2022 00:55:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1snlMObRye/utAXAnPcAx+AMxu76AkR/vLHzIosTSZtStjILUc7qkiUYE61rN3+T+Uwyc9EOg== X-Received: by 2002:adf:d1cf:0:b0:21d:a2cd:522d with SMTP id b15-20020adfd1cf000000b0021da2cd522dmr33169499wrd.383.1658390155583; Thu, 21 Jul 2022 00:55:55 -0700 (PDT) Received: from ?IPV6:2003:cb:c707:e000:25d3:15fa:4c8b:7e8d? (p200300cbc707e00025d315fa4c8b7e8d.dip0.t-ipconnect.de. [2003:cb:c707:e000:25d3:15fa:4c8b:7e8d]) by smtp.gmail.com with ESMTPSA id r5-20020a1c2b05000000b003a03be171b1sm952885wmr.43.2022.07.21.00.55.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Jul 2022 00:55:55 -0700 (PDT) Message-ID: <59ea2abf-deee-0ce7-f14b-d1529eae4ce5@redhat.com> Date: Thu, 21 Jul 2022 09:55:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2 1/3] mm/gup: Add FOLL_INTERRUPTIBLE To: Peter Xu , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: "Dr . David Alan Gilbert" , John Hubbard , Sean Christopherson , Linux MM Mailing List , Andrew Morton , Paolo Bonzini , Andrea Arcangeli References: <20220721000318.93522-1-peterx@redhat.com> <20220721000318.93522-2-peterx@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20220721000318.93522-2-peterx@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LZiDSbvv; spf=none (imf26.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@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=1658390159; 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=JR52ASBNCBrVHKbWP37DJBPzWGapieKRruf6K/rMN8o=; b=w0+5G0hWrDqGMEeBLjGQXEFFwcBykTydQUZs+p2x8qzoUYR/9itdadwb8ZO8EwXNQ0A/vI gZrvV+JYCWV/2BMj/OKk/8TSpPiC5g3Y7aD5Dw6QXjEgOc5CNGBziU+Mq0Z5usjg3JIUdF ypw8RoFWIiB++AVW9Fw5UtWxIo+6pTM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658390159; a=rsa-sha256; cv=none; b=KAiUr9pXGa69SnRsfncO1M3NOER1oWOq0wayY1unsZ/QYMjfc9ks9iX/z6IPufsi06yRU4 Cn0Dtl5Wp7Sw+M1Dkx6dIBPt92JOWIdFr/KbqfNu7qo5k1F0XMeV/070ulxOq80YpU0E2V ucHJ5TgvdLoZLccY50kiX1qcqY2/igA= X-Rspam-User: X-Rspamd-Queue-Id: 2AB0614001B Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LZiDSbvv; spf=none (imf26.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: 4wkumrgu1yonh6upn3cpbnfmp9x7r8wd X-Rspamd-Server: rspam07 X-HE-Tag: 1658390159-818538 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 21.07.22 02:03, Peter Xu wrote: > We have had FAULT_FLAG_INTERRUPTIBLE but it was never applied to GUPs. One > issue with it is that not all GUP paths are able to handle signal delivers > besides SIGKILL. > > That's not ideal for the GUP users who are actually able to handle these > cases, like KVM. > > KVM uses GUP extensively on faulting guest pages, during which we've got > existing infrastructures to retry a page fault at a later time. Allowing > the GUP to be interrupted by generic signals can make KVM related threads > to be more responsive. For examples: > > (1) SIGUSR1: which QEMU/KVM uses to deliver an inter-process IPI, > e.g. when the admin issues a vm_stop QMP command, SIGUSR1 can be > generated to kick the vcpus out of kernel context immediately, > > (2) SIGINT: which can be used with interactive hypervisor users to stop a > virtual machine with Ctrl-C without any delays/hangs, > > (3) SIGTRAP: which grants GDB capability even during page faults that are > stuck for a long time. > > Normally hypervisor will be able to receive these signals properly, but not > if we're stuck in a GUP for a long time for whatever reason. It happens > easily with a stucked postcopy migration when e.g. a network temp failure > happens, then some vcpu threads can hang death waiting for the pages. With > the new FOLL_INTERRUPTIBLE, we can allow GUP users like KVM to selectively > enable the ability to trap these signals. > > Reviewed-by: John Hubbard > Signed-off-by: Peter Xu Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb