Most famines were too long and large for stockpiles, they were always a general avaiability and distribution problem (holodomor, Ireland, Bengal, Africa multiple times). Fun thing so, society as whole never really collapsed, not even during the Plague.
It’s not unusual for Preppers to store a year of food or more for the entire family. That absolutely would make the difference in surviving even a many year famine.
The idea that storing large amounts of food to prepare for shortages is useless is a really silly concept considering how widespread it is amongst humans and many other mammals.