From nobody Mon Feb 9 08:28:01 2026 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF48F47A64 for ; Thu, 4 Jul 2024 04:32:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720067561; cv=none; b=BWqRKVBqzrb9CbhaNfmvO33zGYPAfJYs9BP2+YkAhKxZy60WNkK9yLH9QdaPf1nHbgXjh3Yyft5pc9oJY4uenVCrqR0pYe/BWLHFL5WsoiQpUlclL5nwJPQB1X0+jJ4gybSUfZJ1Bst5mKCIuRwtNjEI+YP8hld9Yy7ahPpn1Wg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720067561; c=relaxed/simple; bh=kqCSDZ05ilm/0TUzR8rJaPdyK3biGq/s90mBx1aESYo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WQ5iP3udpGfn/9eQ4cgXVzzZFvNW3Z92HroxofqAcRTlmL/jXkz94d9bnmVVoPWMAl/ypSQZHTxXtJDJuIJhFuYkxTt6HaDU/F8ukuUtFYpN6AEhrHSJRro0Ub6N5c1ari2LWNpPBX6jNptdWKoyK86OYPPTJGsExthJs27tLNo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=wu38pd2U; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=3vLpc8uy; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=wu38pd2U; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=3vLpc8uy; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="wu38pd2U"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="3vLpc8uy"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="wu38pd2U"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="3vLpc8uy" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 4E4831FCF7; Thu, 4 Jul 2024 04:32:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1720067558; h=from:from:reply-to: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=Lrt/KcsLV9mhSUC002LaYTg+7UaG25OX7K0/IX8flZ0=; b=wu38pd2Ur04WQggmlopkDml4wHinDJSRhnDrkpQt+PtRYgYO79418P+xobCSITpMNuUGJr N+r3hCiv4ga0bzDDG6Hf5y+011wgZlCP9rDrAInPoWk4nEgL/L2Ryqm/Fs6j9r+hmIMepL jQdzslJTtqTqyHqPiP2tBLeURFlt62k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1720067558; h=from:from:reply-to: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=Lrt/KcsLV9mhSUC002LaYTg+7UaG25OX7K0/IX8flZ0=; b=3vLpc8uy3DMDbdMeN7hpDSFZj9ThV9qGHZSesmupuyJqz3PIjoXBK+9NW6fTTC/h3zsQFl 1ol0a9rc5zXXd3CQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1720067558; h=from:from:reply-to: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=Lrt/KcsLV9mhSUC002LaYTg+7UaG25OX7K0/IX8flZ0=; b=wu38pd2Ur04WQggmlopkDml4wHinDJSRhnDrkpQt+PtRYgYO79418P+xobCSITpMNuUGJr N+r3hCiv4ga0bzDDG6Hf5y+011wgZlCP9rDrAInPoWk4nEgL/L2Ryqm/Fs6j9r+hmIMepL jQdzslJTtqTqyHqPiP2tBLeURFlt62k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1720067558; h=from:from:reply-to: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=Lrt/KcsLV9mhSUC002LaYTg+7UaG25OX7K0/IX8flZ0=; b=3vLpc8uy3DMDbdMeN7hpDSFZj9ThV9qGHZSesmupuyJqz3PIjoXBK+9NW6fTTC/h3zsQFl 1ol0a9rc5zXXd3CQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 370FC13889; Thu, 4 Jul 2024 04:32:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 4F+tCOUlhmbnDAAAD6G6ig (envelope-from ); Thu, 04 Jul 2024 04:32:37 +0000 From: Oscar Salvador To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Peter Xu , Muchun Song , David Hildenbrand , SeongJae Park , Miaohe Lin , Michal Hocko , Matthew Wilcox , Christophe Leroy , Oscar Salvador Subject: [PATCH 38/45] mm/madvise: Make swapin_test_walk skip hugetlb vmas Date: Thu, 4 Jul 2024 06:31:25 +0200 Message-ID: <20240704043132.28501-39-osalvador@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240704043132.28501-1-osalvador@suse.de> References: <20240704043132.28501-1-osalvador@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-6.80 / 50.00]; REPLY(-4.00)[]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCPT_COUNT_TWELVE(0.00)[12]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; R_RATELIMIT(0.00)[to_ip_from(RLghcz9uomn9ay1xnuhrww8uur)]; RCVD_TLS_ALL(0.00)[] X-Spam-Flag: NO X-Spam-Score: -6.80 X-Spam-Level: Content-Type: text/plain; charset="utf-8" Skip hugetlb vmas as we are not interested in those. Signed-off-by: Oscar Salvador --- mm/madvise.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mm/madvise.c b/mm/madvise.c index 96c026fe0c99..4c7c409e8b4a 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -212,8 +212,20 @@ static int swapin_walk_pmd_entry(pmd_t *pmd, unsigned = long start, return 0; } =20 +static int swapin_test_walk(unsigned long start, unsigned long end, + struct mm_walk *walk) +{ + struct vm_area_struct *vma =3D walk->vma; + + if (is_vm_hugetlb_page(vma)) + return 1; + + return 0; +} + static const struct mm_walk_ops swapin_walk_ops =3D { .pmd_entry =3D swapin_walk_pmd_entry, + .test_walk =3D swapin_test_walk, .walk_lock =3D PGWALK_RDLOCK, }; =20 --=20 2.26.2