Laconic version: "Probably not: si_meminfo() is your friend".
Verbose version:
I don't think you really want nr_free_highpages(), that's transient
info - it won't usually fall so low as 0 if there is highmem, but do
you want to rely on that? And nr_free_highpages() is CONFIG_HIGHMEM
only, so you'd need #ifdef CONFIG_HIGHMEM around its call in 3c59x.c.
But si_meminfo() is already exported: I think sysinfo.totalhigh is
what you want to check; if I'm wrong, and you really are interested
in whether there are currently free highpages, sysinfo.freehigh
gives you that too without needing a new export.
(I think there probably will be a need for new interfaces
to export more per-zone memory info, but not for this.)
Hugh
--- linux-2.4.7-ac2/drivers/net/3c59x.c Sat Jul 28 07:12:03 2001
+++ linux/drivers/net/3c59x.c Sun Jul 29 10:53:31 2001
@@ -1299,8 +1299,11 @@
/* The 3c59x-specific entries in the device structure. */
dev->open = vortex_open;
if (vp->full_bus_master_tx) {
+ struct sysinfo sysinfo;
+
dev->hard_start_xmit = boomerang_start_xmit;
- if (nr_free_highpages() == 0) {
+ si_meminfo(&sysinfo);
+ if (sysinfo.totalhigh == 0) {
/* Actually, it still should work with iommu. */
dev->features |= NETIF_F_SG;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/