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=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,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 C599DC433DB for ; Wed, 24 Feb 2021 22:55:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D8FC64F06 for ; Wed, 24 Feb 2021 22:55:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D8FC64F06 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=dme.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:42104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lF33z-0003Am-J3 for qemu-devel@archiver.kernel.org; Wed, 24 Feb 2021 17:55:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lF32R-0002Hc-Hd for qemu-devel@nongnu.org; Wed, 24 Feb 2021 17:53:48 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:39813) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lF32P-0000UU-MI for qemu-devel@nongnu.org; Wed, 24 Feb 2021 17:53:47 -0500 Received: by mail-wr1-x432.google.com with SMTP id v1so3413209wrd.6 for ; Wed, 24 Feb 2021 14:53:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dme-org.20150623.gappssmtp.com; s=20150623; h=to:cc:subject:in-reply-to:references:from:date:message-id :mime-version; bh=OyNFwRqHRBVpAGK1YTrrlzvhueUuW3vMZT2fUmQYp8o=; b=ys8x6I0roemPQ12tTqD1I7nV15qA2uOsDQuyUXKLpJA8x92S22BcZdgovKC6auqE6k I0s3/OB0nmR16zxvQ7LKkhlSrHINZYsvtQxhM5BSVg4uK0wqnH/pUPOeXBovERSzdF1w xx4iLwjlQqNf3MWcvN6jlpojsayQAjAu3l2KIp9TxqRHYNM5CCvlgBLpV8ImOwJ0jdds gS1/Y6yA/z0rKSTA9ICyG084KGillt3j0MTdASASBZRdjeoavU5+/v/rJo8Xd6lYFWvZ k+b93mR7fb/dPhru3itIxYai9Ba8MQs/jwkP9NaygfKIh5gW/aXTFTA/E+cPN6uH8lXe 8ptA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:subject:in-reply-to:references:from:date :message-id:mime-version; bh=OyNFwRqHRBVpAGK1YTrrlzvhueUuW3vMZT2fUmQYp8o=; b=FzXEijnmAsrW4jOyxXD6v66eXglP3Q0O7ZbVnZwMB1uDoRaWLCCfHR5DB12TXGEx/y 99VUC83kC6BsrzjiJAA4WXyIFKX72V9km5xVlOjCiqiVH5ewaHyHGTzbyyOcCwoY0W3j jBt1RC1QbJDN4AzOzM3QxhiOxx0i7Yg6bi+KYnFwjDzOsW7omF6C7lFtlU6xTyW21aIT USVIjyv/kqc/UwpRJlld2+KDQypp8wvWPzQT3BRrphY7smcZeQa6SmdbUKeqU6RwIT0K UxXW3Rek/gwR5JjNR1SZCo07FGpV56MFCgtQBolndT4blIGruJiqU74Ei9PjituzxsnE RYdw== X-Gm-Message-State: AOAM531SVOSs6fsMDSVSxv+xfz6XH2sOZtuP+EyBQWkR9VWFkZVY1bOD M0getblxgB0qkL1plIZV00GYwg== X-Google-Smtp-Source: ABdhPJwUzGEKGlnJgXzYfhgRZlHSrPgN8nox3ZBTUW/ggC9YkjZ//K4W/Fr3bPsIYgZWXwO3rX85fg== X-Received: by 2002:a05:6000:188c:: with SMTP id a12mr286383wri.105.1614207222854; Wed, 24 Feb 2021 14:53:42 -0800 (PST) Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net. [2001:8b0:bb71:7140:64::1]) by smtp.gmail.com with ESMTPSA id q20sm4746444wmc.14.2021.02.24.14.53.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 14:53:42 -0800 (PST) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id d32daa1c; Wed, 24 Feb 2021 22:53:41 +0000 (UTC) To: Kunkun Jiang , Juan Quintela , "Dr . David Alan Gilbert" , "open list:All patches CC here" Subject: Re: [PATCH 1/3] migration/ram: Modify the code comment of ram_save_host_page() In-Reply-To: <20210223021646.500-2-jiangkunkun@huawei.com> References: <20210223021646.500-1-jiangkunkun@huawei.com> <20210223021646.500-2-jiangkunkun@huawei.com> X-HGTTG: zarquon From: David Edmondson Date: Wed, 24 Feb 2021 22:53:41 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: neutral client-ip=2a00:1450:4864:20::432; envelope-from=dme@dme.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779, UNPARSEABLE_RELAY=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zenghui Yu , wanghaibin.wang@huawei.com, Keqian Zhu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tuesday, 2021-02-23 at 10:16:43 +08, Kunkun Jiang wrote: > The ram_save_host_page() has been modified several times > since its birth. But the comment hasn't been modified as it should > be. It'd better to modify the comment to explain ram_save_host_page() > more clearly. > > Signed-off-by: Keqian Zhu > Signed-off-by: Kunkun Jiang > --- > migration/ram.c | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/migration/ram.c b/migration/ram.c > index 72143da0ac..fc49c3f898 100644 > --- a/migration/ram.c > +++ b/migration/ram.c > @@ -1970,15 +1970,16 @@ static int ram_save_target_page(RAMState *rs, PageSearchStatus *pss, > } > > /** > - * ram_save_host_page: save a whole host page > + * ram_save_host_page: save a whole host page or the rest of a block > * > - * Starting at *offset send pages up to the end of the current host > - * page. It's valid for the initial offset to point into the middle of > - * a host page in which case the remainder of the hostpage is sent. > - * Only dirty target pages are sent. Note that the host page size may > - * be a huge page for this block. > - * The saving stops at the boundary of the used_length of the block > - * if the RAMBlock isn't a multiple of the host page size. > + * Starting at pss->page send pages up to the end of the current host > + * page or the boundary of used_length of the block (if the RAMBlock > + * isn't a multiple of the host page size). The min one is selected. > + * Only dirty target pages are sent. > + * > + * Note that the host page size may be a huge page for this block, it's > + * valid for the initial offset to point into the middle of a host page > + * in which case the remainder of the hostpage is sent. How about: * Send dirty pages between pss->page and either the end of that page or * the used_length of the RAMBlock, whichever is smaller. * * Note that if the host page is a huge page, pss->page may be in the * middle of that page. > * > * Returns the number of pages written or negative on error > * > -- > 2.23.0 dme. -- I'm in with the in crowd, I know every latest dance.