Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4271509pxu; Mon, 12 Oct 2020 14:27:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFYYn6mxAw5iy8oYTrNBZxvSV2WF/TSB9eRnlp/80vj5fki0zCr/4u8ToeEes8Yb2h9OYW X-Received: by 2002:aa7:c7c2:: with SMTP id o2mr16955875eds.366.1602538037870; Mon, 12 Oct 2020 14:27:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602538037; cv=none; d=google.com; s=arc-20160816; b=fNQU6btn6+LMXDQYCHBnhE/Hlqwa4eX6QEDfeVzKn/PjNNGauJj2+uesoFU/Y0W8sD 83YZDITAi680O8WrwUn990hBKlGnr0zsyY/rEyVXJ7u8/6D7NZV5/oVgb89/RGcJHO+u J4MSgGZbaWwEMi6rymFwaqTq9aN7rd8FZMhTyQ0CZ8Z9BlvjrPPwqBhlpOkH68Ao0mY0 FvQBFPx+V4gBR/7NHxsQvCa7uS6LVWKUXuLRUEfuuVnvoQfbxLzYNnE2YwVPkklr25eK oGVuyco9sq3jBHU+rcQh4/Po/rKHnJAZKXyqNGBPc/8h64Sx+iUCpGa6Jjz4biSX3Zu1 ienw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JHR5D8sA0HIDc7HwQ6f0+KqNbCPLWQmlx+xqVzasTCw=; b=LOutBoZg4C0ByxySg0MxQ+znOj2aDG+NQbgoomWhwjqX6EhDveuyHqWRSELpka1Oww OhRmliZ+iJpuJQp3oS/hhp4XJlSVWAxalZdFg5PAJnxCUoJ/3eOf4m/0DiBKQwvt1XQY LhGM/qrD9MrVBmjp/FCh3xqPHNPpW1hIpXkh013Hd8J8P/0VQqNo235beNPW061J0YGj 8ot6wtDXItWLeA3l9kgK0+vdpzv7Bt5TY7itcFBLPzeWT/Lt6j7VQ+CwxxhQXy8tSyWP PJpA1UDrga6c23+ECMOkZ0bUV536FfgjiGnrDe+eDuZa2LpPH29qqLAsoz3ybKRvah+n RMCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a+T4jKpp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r1si12755672eja.274.2020.10.12.14.26.55; Mon, 12 Oct 2020 14:27:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a+T4jKpp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730243AbgJLM4e (ORCPT + 99 others); Mon, 12 Oct 2020 08:56:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42829 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726863AbgJLM4a (ORCPT ); Mon, 12 Oct 2020 08:56:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602507388; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JHR5D8sA0HIDc7HwQ6f0+KqNbCPLWQmlx+xqVzasTCw=; b=a+T4jKpph8zd/H5cZuof32n2tkc7TyFMdLplc2WBiQNY61wXPCUvzVZJgfF8p0ifKaiia8 vQUmntg1JD8BoOVC3BGfvKHhx5w2HeSihC/o+5N/QJJIX70N5mAq3y/OETMmzAylMyklrO grwjjRqTXye54q60dL8D1p8QU678hpc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-589-kASBXn0gPneiWH6X_Z8vZw-1; Mon, 12 Oct 2020 08:56:24 -0400 X-MC-Unique: kASBXn0gPneiWH6X_Z8vZw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 84831802B6A; Mon, 12 Oct 2020 12:56:23 +0000 (UTC) Received: from t480s.redhat.com (ovpn-113-251.ams2.redhat.com [10.36.113.251]) by smtp.corp.redhat.com (Postfix) with ESMTP id B622D6198B; Mon, 12 Oct 2020 12:56:11 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, virtualization@lists.linux-foundation.org, Andrew Morton , "Michael S . Tsirkin" , David Hildenbrand , Jason Wang , Pankaj Gupta Subject: [PATCH v1 21/29] virtio-mem: memory notifier callbacks are specific to Sub Block Mode (SBM) Date: Mon, 12 Oct 2020 14:53:15 +0200 Message-Id: <20201012125323.17509-22-david@redhat.com> In-Reply-To: <20201012125323.17509-1-david@redhat.com> References: <20201012125323.17509-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let's rename accordingly. Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Pankaj Gupta Signed-off-by: David Hildenbrand --- drivers/virtio/virtio_mem.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c index 3a772714fec9..d06c8760b337 100644 --- a/drivers/virtio/virtio_mem.c +++ b/drivers/virtio/virtio_mem.c @@ -589,8 +589,8 @@ static bool virtio_mem_contains_range(struct virtio_mem *vm, uint64_t start, return start >= vm->addr && start + size <= vm->addr + vm->region_size; } -static int virtio_mem_notify_going_online(struct virtio_mem *vm, - unsigned long mb_id) +static int virtio_mem_sbm_notify_going_online(struct virtio_mem *vm, + unsigned long mb_id) { switch (virtio_mem_sbm_get_mb_state(vm, mb_id)) { case VIRTIO_MEM_SBM_MB_OFFLINE_PARTIAL: @@ -604,8 +604,8 @@ static int virtio_mem_notify_going_online(struct virtio_mem *vm, return NOTIFY_BAD; } -static void virtio_mem_notify_offline(struct virtio_mem *vm, - unsigned long mb_id) +static void virtio_mem_sbm_notify_offline(struct virtio_mem *vm, + unsigned long mb_id) { switch (virtio_mem_sbm_get_mb_state(vm, mb_id)) { case VIRTIO_MEM_SBM_MB_ONLINE_PARTIAL: @@ -622,7 +622,8 @@ static void virtio_mem_notify_offline(struct virtio_mem *vm, } } -static void virtio_mem_notify_online(struct virtio_mem *vm, unsigned long mb_id) +static void virtio_mem_sbm_notify_online(struct virtio_mem *vm, + unsigned long mb_id) { switch (virtio_mem_sbm_get_mb_state(vm, mb_id)) { case VIRTIO_MEM_SBM_MB_OFFLINE_PARTIAL: @@ -639,8 +640,8 @@ static void virtio_mem_notify_online(struct virtio_mem *vm, unsigned long mb_id) } } -static void virtio_mem_notify_going_offline(struct virtio_mem *vm, - unsigned long mb_id) +static void virtio_mem_sbm_notify_going_offline(struct virtio_mem *vm, + unsigned long mb_id) { const unsigned long nr_pages = PFN_DOWN(vm->sbm.sb_size); unsigned long pfn; @@ -655,8 +656,8 @@ static void virtio_mem_notify_going_offline(struct virtio_mem *vm, } } -static void virtio_mem_notify_cancel_offline(struct virtio_mem *vm, - unsigned long mb_id) +static void virtio_mem_sbm_notify_cancel_offline(struct virtio_mem *vm, + unsigned long mb_id) { const unsigned long nr_pages = PFN_DOWN(vm->sbm.sb_size); unsigned long pfn; @@ -716,7 +717,7 @@ static int virtio_mem_memory_notifier_cb(struct notifier_block *nb, break; } vm->hotplug_active = true; - virtio_mem_notify_going_offline(vm, mb_id); + virtio_mem_sbm_notify_going_offline(vm, mb_id); break; case MEM_GOING_ONLINE: mutex_lock(&vm->hotplug_mutex); @@ -726,10 +727,10 @@ static int virtio_mem_memory_notifier_cb(struct notifier_block *nb, break; } vm->hotplug_active = true; - rc = virtio_mem_notify_going_online(vm, mb_id); + rc = virtio_mem_sbm_notify_going_online(vm, mb_id); break; case MEM_OFFLINE: - virtio_mem_notify_offline(vm, mb_id); + virtio_mem_sbm_notify_offline(vm, mb_id); atomic64_add(size, &vm->offline_size); /* @@ -743,7 +744,7 @@ static int virtio_mem_memory_notifier_cb(struct notifier_block *nb, mutex_unlock(&vm->hotplug_mutex); break; case MEM_ONLINE: - virtio_mem_notify_online(vm, mb_id); + virtio_mem_sbm_notify_online(vm, mb_id); atomic64_sub(size, &vm->offline_size); /* @@ -762,7 +763,7 @@ static int virtio_mem_memory_notifier_cb(struct notifier_block *nb, case MEM_CANCEL_OFFLINE: if (!vm->hotplug_active) break; - virtio_mem_notify_cancel_offline(vm, mb_id); + virtio_mem_sbm_notify_cancel_offline(vm, mb_id); vm->hotplug_active = false; mutex_unlock(&vm->hotplug_mutex); break; -- 2.26.2