Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2132945lqb; Mon, 27 May 2024 08:52:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWjF2XQMZ/qy7fF77T9TZ1bsHtpcwXpGyWLnMM+t1e9zOw8yjvopxN9jDRYS2Ifr2vgPMQwRS2rHBuR6MZYJ/nZtj8OSInIOGvabE+9Rg== X-Google-Smtp-Source: AGHT+IHplP3yJDUTgfps3JWK9EcjGp11VxekrJoJldE9EaoacQaMSGNYLJl0+5xmNEc3MoC+Ivp3 X-Received: by 2002:a05:6214:390b:b0:6ad:657a:5892 with SMTP id 6a1803df08f44-6ad657a59camr79613986d6.61.1716825168549; Mon, 27 May 2024 08:52:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716825168; cv=pass; d=google.com; s=arc-20160816; b=RQTFF38U08r+YFW+hBnOpZ5TH7YUAM+ZvLjC2R5Yz+ZCmBProVAVAJJyRu4rSbJG7T FlFoPcb8wMv8zluS28rogyDVlVoLPPCIkhZRszGloEiuPDLNlZe9rBp8pJh0AGfff1JC MLuTZ9GN96mc9n4QxnV88GKcWYzvJZLqIGjNMIUKWgAmh1CcrBXiQzpRZeTzw8knWi/i FAONKFC9pn2kSFKGf+a1RQzOW7mAlcwF4D/W4bxRlKSykjGBWohxvm8XIIy/AYD7bBWK iZPAJTIFVAGEpjHxOLk6Gr1/gwYIQtFoTfmnyUQApbQNHn4/2DL7Ypk4bUzSmD+Zz0bk ct7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LizxiP53j7D2NoPkmTsvm1+adARrQRUkvK742gCLD4s=; fh=rFzvMnGf+O23oB1Q27r7xrw+Je448UdBVnFq5ai6UpY=; b=ZCaVbTHJoOBnKVpAxbm6UKtBOwQ7jKaajeSCIkiol5j1hllg4fJqq+hfAHTG2el1Qn 5sMh+zeyKlJze0M4L1KGuQBETwxJ+EZhselILJpQOygZakPGUSJ2/1Ud6sLP+l+XPgwQ s6HvjysJ24UtaIrpZuYHlWiucdKxU/zbaWXq9hc/KfMlkiV3QX3VVqQ+/HOtSWNd4azp ho+/hbd5CVcRHSqNQIBOEIJC/wXdnNIu/sHNVOiWHUVkNvFi/q5GrKy60eBdBRB3y4oi V+cilM1StmbENOIpE9pZjZNs68EdMLiqy6D2tUPUegmS89cImwDLwRHvUak5y0CB/Dzf qDbg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=xyHfZBAP; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-190646-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190646-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ad740cd157si52864696d6.300.2024.05.27.08.52.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 08:52:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190646-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=xyHfZBAP; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-190646-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190646-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DBC141C237EC for ; Mon, 27 May 2024 13:03:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 146A315F41E; Mon, 27 May 2024 12:58:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="xyHfZBAP" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4EE115ECE4; Mon, 27 May 2024 12:58:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716814733; cv=none; b=kPtJ7T27rEL3d0LrY3R4I/7Sj3np0TaMpGexzkCwySCAJqaB5VIINIJTWhUtj+AnOw13bYUMspHNYg7EVI01HAyAtEfKrE+oA9SZ3NnHNUzfQM2mKAmrRBac/9DluUeh9edFRtQzC68xHEdyAIhrJT238ifLKQHrhAxnQ4ooRRM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716814733; c=relaxed/simple; bh=Y5EStVtK5WBwaVqJnTBpsLDGG9CDOGGAhpofJDguFsc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=AM9dU4cLOUMbVsGu2JLfRERJfqrcjMRpVGq205lCcPkKzJh72qeSjj2AJaUZUK0wfQwxnHj9Hc5k/Go3RfBWs78kReLwcvh0t4ILY/6ad5MUcSiqjxUgHRsFls3GRs3lPoLGW1zct9Q7ZFwCyoMY+k4gFCX15dNGhYG8YXdwsYo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=xyHfZBAP; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=LizxiP53j7D2NoPkmTsvm1+adARrQRUkvK742gCLD4s=; b=xyHfZBAP16UcddrMhJmpJz3Jd6 5ksXFxX2gBhXrU2IeCQijkzwenNq+TDmDH9VGK7TboOMDwG6iZxIGJNrLoqEbpsomJR8y9g+jzRFg LImskVT7Q6JV9hTwFqhDDEvFt+gLbWJZ9KZ4c+Q5DSbZd3tX+TOoWMywiF6cmQKJyRlP9OlgF+jeA NGJfpZJflKTevGmnksZ4mPAPSI5L/hbzRO39rLbPts2lpLKLQjz+Bd5O8SkOWimf2xJ2yoAciiMIY O4QdhHFpiEX88VxN5edNdV+Kz88wcLesD3dKy2xO9CLfNB7pMt00b+vOgCjzEfI6VZ1xbgrdb9OUh KO6+F1kg==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBZwA-0000000EysS-0LnS; Mon, 27 May 2024 12:58:50 +0000 Date: Mon, 27 May 2024 05:58:50 -0700 From: Christoph Hellwig To: "Sukrit.Bhatnagar@sony.com" Cc: Christoph Hellwig , Pavel Machek , "Rafael J. Wysocki" , Christian Brauner , "Darrick J. Wong" , Andrew Morton , "linux-xfs@vger.kernel.org" , "linux-pm@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: [PATCH 0/2] Improve dmesg output for swapfile+hibernation Message-ID: References: <20240522074658.2420468-1-Sukrit.Bhatnagar@sony.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Mon, May 27, 2024 at 12:51:07PM +0000, Sukrit.Bhatnagar@sony.com wrote: > In my understanding, the resume offset in hibernate is used as follows. > > Suspend > - Hibernate looks up the swap/swapfile using the details we pass in the > sysfs entries, in the function swsusp_swap_check(): > * /sys/power/resume - path/uuid/major:minor of the swap partition (or > non-swap partition for swapfile) > * /sys/power/resume_offset - physical offset of the swapfile in that > partition > * If no resume device is specified, it just uses the first available swap! > - It then proceeds to write the image to the specified swap. > (The allocation of swap pages is done by the swapfile code internally.) Where "it" is userspace code? If so, that already seems unsafe for a swap device, but definitely is a no-go for a swapfile. > - Hibernate gets the partition and offset values from kernel command-line > parameters "resume" and "resume_offset" (which must be set from > userspace, not ideal). Or is it just for these parameters? In which case we "only" need to specify the swap file, which would then need code in the file system driver to resolve the logical to physical mapping as swap files don't need to be contiguous.